Commit Graph

120055 Commits

Author SHA1 Message Date
Jacques Lucke
59e6cfb43b Fix: Geometry Nodes: add check if closure should log
Note that currently this function always returns false until #137403.
2025-04-15 10:34:18 +02:00
Jacques Lucke
234cfbb865 Nodes: add zone utility functions
Those are used by #137403.
2025-04-15 10:32:00 +02:00
Omar Emara
3c61691559 Compositor: Mark Mask node options as deprecated
Those were converted into options already.
2025-04-15 09:56:11 +02:00
Campbell Barton
5741e28770 Revert "Fix: Compositor: Crash in Movie Distortion node with extreme distortions"
This reverts commit 2dff457a7c.

This caused compositor_cpu_distort test to fail.
2025-04-15 15:26:14 +10:00
Campbell Barton
c49e6a7dd4 Cleanup: reference operators as symbols, spelling in comments 2025-04-15 15:22:53 +10:00
Campbell Barton
8e40e21124 Cleanup: use boolean for "found" vars & return values 2025-04-15 12:08:08 +10:00
Campbell Barton
217406ec42 Cleanup: move IMB_convert_rgba_to_abgr to a static function
This is a fairly specific function and was only used by the IRIS format.
2025-04-15 12:08:08 +10:00
Sean Kim
1f003c08ee Fix #137449: Face Set gesture in Dyntopo doesn't create attribute
Prior to this commit, Using the gesture Face Set operators on a mesh
that doesn't have the `.sculpt_face_set` attribute created would lead to
invalid data being written and ultimately a crash.

To fix this, use the `ensure_face_sets_bmesh` function.

This commit also ensures that the `find_next_available_id` function
doesn't return `1` for the next face set id for BMesh.

Pull Request: https://projects.blender.org/blender/blender/pulls/137492
2025-04-15 03:51:01 +02:00
Sean Kim
f8622702f5 Fix #137494: Dyntopo crash after undoing Random Mask
Introduced with 1d83a88fdc.

Pull Request: https://projects.blender.org/blender/blender/pulls/137495
2025-04-15 03:45:15 +02:00
Sean Kim
0c116e7a83 Fix #137496: Dyntopo mask undo doesn't update paint BVH state
When undoing dyntopo actions, we have a fast path where if the mask
layer was affected, we avoid a full depsgraph tagging and BVH rebuild.

This tagging was missing recalculating the overall node visibility
states, potentially preventing further brush strokes and actions from
working if they filtered out fully hidden nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/137502
2025-04-15 03:44:39 +02:00
Harley Acheson
5102880f51 UI: Decrease Tablet Drag Threshold With Pen Pressure
We have separate drag movement thresholds, and one is specifically for
tablet pen movement. A movement is not considered a drag (when using
left click select) until this amount is detected. This PR decreases
that amount with pen pressure. This results in more immediate and
responsive behavior that feels quite natural. Whether using RCS or
LCS this also similarly reduces the lag when dragging on numerical
inputs and sliders.

Pull Request: https://projects.blender.org/blender/blender/pulls/136685
2025-04-15 02:51:15 +02:00
Harley Acheson
2690c0266a Fix #137430: Improved Calculation of Minimum Vertical Area Heights
Since the changes that allow user select-able border widths our
calculation of minimum area heights is incorrect in that it does not
take into account border width.  This PR improves this calculation so
that as you resize windows and areas none go below header height.

Pull Request: https://projects.blender.org/blender/blender/pulls/137498
2025-04-15 01:23:41 +02:00
Jonas Holzman
81efb13f49 UI: Use Theme Color for Initial Window Background
This patch makes it so that the theme color is used for the
initial/loading Blender window background color. Unlike what
it may look like, theme settings are well loaded at this point
in the initialization process, which lets us directly use them
for coloring the window background instead of relying on a
default grey color.

This also makes the colored titlebar window decorations (introduced in
#123982 for macOS, #134054 for Windows 11), always blend with the window
instead of looking somewhat broken during window initialization. On the
technical side, this uses the top-bar header background theme color to
ensure this always matches with the color used by the colored titlebar.

Pull Request: https://projects.blender.org/blender/blender/pulls/137425
2025-04-14 22:36:16 +02:00
Lukas Stockner
2dff457a7c Fix: Compositor: Crash in Movie Distortion node with extreme distortions
While testing some distortion options, I noticed that the Movie Distortion node
would crash when used with e.g. (0.0, 0.0, 0.5) as the lens parameters.

This appears to be caused by 00ee917fd. Turns out that even though the input was
512x384, the extended size ended up being around 600000x500000, which obviously
caused some issues.

Therefore, this patch a) clamps the margin to be at most as wide as the input
(so 9x the pixels in the worst case) and b) fixes the indexing calculations to
not overflow the int32 values in case the input is legitimately huge.

Pull Request: https://projects.blender.org/blender/blender/pulls/137440
2025-04-14 20:29:42 +02:00
Harley Acheson
380f9973b6 UI: Allow Using Mac Option, Command + Arrow Input Movement
On MacOS, while editing text in an input field, allow pressing Option+
Arrow to move to next word, Command+Arrow to move to beginning and end
of the string.

Pull Request: https://projects.blender.org/blender/blender/pulls/136904
2025-04-14 20:28:58 +02:00
Iliya Katushenock
4da97bfbcc Fix: Geometry Nodes: Scale Elements non-deterministic results
Pull Request: https://projects.blender.org/blender/blender/pulls/136046
2025-04-14 14:16:41 -04:00
Hans Goudey
3b9c2c810d Fix #137392: Hair Particle "Shape Cut" operator crash after Mesh BVH caching
Mistake in bcfe4c34da
2025-04-14 11:53:30 -04:00
Hans Goudey
c6d938fa72 Cleanup: Remove unnecessary mesh positions write access 2025-04-14 11:53:30 -04:00
Jacques Lucke
6fda6c2894 Fix: another merge conflict
Caused by 7f1a99e862.
2025-04-14 17:52:38 +02:00
Jacques Lucke
7f1a99e862 Refactor: BLI: Make some CPPType properties public instead of using methods
This makes accessing these properties more convenient. Since we only ever have
const references to `CPPType`, there isn't really a benefit to using methods to
avoid mutation.

Pull Request: https://projects.blender.org/blender/blender/pulls/137482
2025-04-14 17:48:17 +02:00
Jacques Lucke
be266a1c0c Refactor: Geometry Nodes: replace ComputeContextBuilder with ComputeContextCache
While `ComputeContextBuilder` worked well for building simple linear compute
contexts, it was fairly limiting for all the slightly more complex cases where
an entire tree of compute contexts is built. Using `ComputeContextCache` that is
easier to do more explicitly. There were only very few cases where using
`ComputeContextBuilder` would have still helped a bit, but it's not really worth
keeping that abstraction around just for those few cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/137370
2025-04-14 17:47:56 +02:00
Jacques Lucke
8a52e0d104 Fix: merge conflict after rename
Caused by e8877df863.
2025-04-14 17:47:05 +02:00
Miguel Pozo
719351a9e6 Fix #137427: Overlay: Darker curve sculpt overlay
Use alpha blend (same as legacy).

Pull Request: https://projects.blender.org/blender/blender/pulls/137480
2025-04-14 17:32:01 +02:00
Jacques Lucke
38be46012e Geometry Nodes: pass through in Evaluate Closure by default
Now, if no closure is connected to the Evaluate Closure node, it behaves like if
it is muted. Previously, all outputs were just defaulted and the inputs ignored,
but that's less useful.

Pull Request: https://projects.blender.org/blender/blender/pulls/137418
2025-04-14 17:07:19 +02:00
Mattias Fredriksson
468c42ad16 Cleanup: Remove const from moved local variable
Removed const qualifier as variable is later moved, resulting in C26478:
https://learn.microsoft.com/en-us/cpp/code-quality/c26478?view=msvc-170

Move occurs on line 105 which triggers the warning.

Pull Request: https://projects.blender.org/blender/blender/pulls/137424
2025-04-14 17:05:45 +02:00
Omar Emara
bc9176e5e1 Compositor: Turn Mask options into inputs
This patch turns the options of the Mask node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137479
2025-04-14 17:00:44 +02:00
Jacques Lucke
f557b6c047 Cleanup: Separate CPPType method declarations and implementation
This simplifies scanning the API.
2025-04-14 16:19:18 +02:00
Jacques Lucke
3ae20bf166 Cleanup: remove foreach macro from .clang-format
The usage of that macro was removed in 60bec183cb,
but it was still in our .clang-format file. This lead to worse formatting when other code
used methods named `foreach`.

Pull Request: https://projects.blender.org/blender/blender/pulls/137468
2025-04-14 16:17:00 +02:00
YimingWu
47c7000392 Cleanup: Grease Pencil: Remove unused variables.
Previously the change in f5c0c81b7ee6f127f44543179f17fd475f115842 left
an unused variable and is removed by this fix.
2025-04-14 21:21:52 +08:00
Jacques Lucke
e8877df863 Cleanup: simplify method name 2025-04-14 13:57:31 +02:00
Clément Foucault
3b3a5731df GPU: Shader: Change vector and matrix type to use blender convention
This unify the C++ and GLSL codebase style.

The GLSL types are still in the backend compatibility
layers to support python shaders. However, the C++
shader compilation layer doesn't have them to enforce
correct type usage.

Note that this is going to break pretty much all PRs
in flight that targets shader code.

Rel #137261

Pull Request: https://projects.blender.org/blender/blender/pulls/137369
2025-04-14 13:46:41 +02:00
Omar Emara
10af6e8ca5 Compositor: Turn Time Curve options into inputs
This patch turns the options of the Time Curve node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137465
2025-04-14 13:03:50 +02:00
Bastien Montagne
742c631d04 Fix #136432: Linked Data: Relocating libraries can assert in some cases.
As Relocate code temporarily removes some linked IDs from Main, this can
make collection hierarchy data invalid, in a way that will break
`BKE_main_collections_parent_relations_rebuild`.

For now, simply move that call outside of `BLO_library_link_end` and do
it after adding back all linked IDs to main.

Pull Request: https://projects.blender.org/blender/blender/pulls/135936
2025-04-14 12:54:50 +02:00
Bastien Montagne
3fa35aa4ee LibOverride: Improve resync when relocating linked data.
Relocation is the only case where old and new linked data may have
a different library. This makes remapping dependencies IDs for the
liboverrides that use these linked data somewhat more challenging and
complicated.

From basic tests with both simple data, and full production-level
Mikassa char, it seems to behave fairly well now.
2025-04-14 12:54:48 +02:00
Bastien Montagne
0eba8caaf9 Core: Add 'relocate' operation on individual linked ID.
So far it was only possible to relocate a whole library, now one can
also relocate a single linked ID (pulling in all of its dependencies).

This is essentially linking the new data, remapping local usages of the
old linked data to the new one, removing no more used IDs, and updating
liboverrides if needed.
2025-04-14 12:54:48 +02:00
Miguel Pozo
7f724115f7 Fix: Tests: Init thread API for GPUTests
Required by GPUSecondaryContext.
2025-04-14 12:37:49 +02:00
Jacques Lucke
4af85f09ec Cleanup: move function docs to declaration 2025-04-14 12:35:13 +02:00
Jacques Lucke
cf5a780e7e Fix: memory leak when evaluating closure 2025-04-14 12:21:33 +02:00
Brecht Van Lommel
72b5eff16c Fix: Remove bad ColorBand/CurveMapping/CurveProfile alloc in UI
This code should never get called, but if it did the memory would just leak
and not get stored anywhere.
2025-04-14 11:35:22 +02:00
Omar Emara
08e73814d7 Compositor: Turn Bokeh Image options into inputs
This patch turns the options of the Bokeh Image node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137350
2025-04-14 11:26:55 +02:00
Andrej730
035c0c8606 Fix: PyDocs: document bpy_prop_collection.values() possible None values
Document `bpy_prop_collection.values()` possibility of having
`None` values, unlike `.items()` that seems returns only bpy structs as it's values.

Example snippet with `None` values:
```python
>>> C.object.data.materials
bpy.data.meshes['Cube'].materials
>>> type(C.object.data.materials)
<class 'bpy_prop_collection'>
>>> C.object.data.materials.append(None)
>>> C.object.data.materials.append(None)
>>> C.object.data.materials.append(None)
>>> C.object.data.materials.values()
[bpy.data.materials['Material'], None, None, None]
>>> C.object.data.materials.items()
[('Material', bpy.data.materials['Material'])]
```

Pull Request: https://projects.blender.org/blender/blender/pulls/137302
2025-04-14 11:26:04 +02:00
Pratik Borhade
062c5ab225 Fix #137385: Grease Pencil: Thickness modifier doesn't work with vgroup filter
Use `get_influence_vertex_weights` for thickness modifier. This returns
array of values 0 when group is empty (see `lookup_or_default`).
Function also controls the invert state for vertex group.

Pull Request: https://projects.blender.org/blender/blender/pulls/137455
2025-04-14 10:20:49 +02:00
Jeroen Bakker
b4028ee28f Fix #137395: Vulkan: Memory reset to early
A better solution to solve the memory leak needs to be checked. Partial
revert of 3c70758f00 as it can reset GPUs
or data buffers.
2025-04-14 09:45:14 +02:00
John Kiril Swenson
5a2a6da0a2 VSE: Blade Tool Cursor
This patch adds initial cursor support for the blade tool, with bitmaps
for 16x16, 24x24, and 32x32 cursors.

Additional Changes:
- Locked strips now show a "stop" icon when hovered over.
- Previously, the frame to split was truncated when clicking in between frames.
  Now, round to the closest frame.
- Previously, the blade operator was able to select padded strip handles
  outside of strip bounds. This bug has been resolved, so that selection with
  the blade tool can only happen via box-select passthrough.

Pull Request: https://projects.blender.org/blender/blender/pulls/136749
2025-04-13 22:49:18 +02:00
John Kiril Swenson
fe1e866fb9 VSE: Slip Operator 2.0
This patch completely reworks the slip operator from the ground up,
reorganizing code to be simpler and adding more clarifying documentation.

Major Changes:
- Add modal keymap to the operator along with an interactive status bar.
- Show offset overlays to the left and right of strips whenever slipping.
- Add option to "clamp" slipped strips.
- Rework input to be accumulative, avoiding "jumps" when transitioning in/out
  of precision mode.

Fixes:
- Properly draw header when initializing operator before any events have been
  sent, and reorganize event flow so that all events have an immediate effect.
- Properly clamp subframe slips.

More information in PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/137072
2025-04-13 22:40:46 +02:00
Campbell Barton
dbf6902a19 Fix #137314: Excluded directories ignored when opening from the splash
Regression in [0] which incorrectly swapped the check for the
`use_scripts` property being set with the value it was set to.

Resolve this error as well as the "Recover Last" operator
which never worked.

[0]: 8c688a052c
2025-04-13 12:25:44 +00:00
Campbell Barton
e113c5bb91 Fix: crash drawing poly-line gesture
Regression in [0], buffer overflow reading a short array as floats.

Support short array and fix glitch where the mouse cursor wasn't
included in the poly-line.

[0]: 9d4d1aea98
2025-04-13 22:08:14 +10:00
Jacques Lucke
223412b6d5 Geometry Nodes: name based internal links in Evaluate Closure node
Previously, internal links used the same heuristics as most other nodes. However,
this is more problematic here, because I intend to use the same internal links
for the case when no closure is connected. The behavior in this case should not
change in the future if we decide to change the heuristic for internal links for
muted nodes.
2025-04-13 12:27:01 +02:00
Jacques Lucke
d9a88ce34f Fix: bad index when setting default closure outputs 2025-04-13 12:01:47 +02:00
Jacques Lucke
294a676c59 Fix: Geometry Nodes: prevent evaluating closures recursively 2025-04-13 11:01:37 +02:00