Commit Graph

118328 Commits

Author SHA1 Message Date
YimingWu
c31c2656e4 Fix #135673: Grease Pencil: Dash modifier deletes unfiltered strokes
Grease Pencil dash modifier wasn't merging strokes from strokes that are
unfiltered, resulted in only filtered strokes being shown afterwards.
This fix joins generated strokes with what's left behind so there's no
stroke missing.

Pull Request: https://projects.blender.org/blender/blender/pulls/135705
2025-03-10 19:59:14 +08:00
Julian Eisel
674c315182 Merge branch 'blender-v4.4-release' 2025-03-10 12:58:34 +01:00
YimingWu
2e5c223f37 Fix #135673: Grease Pencil: Dash modifier deletes unfiltered strokes
Grease Pencil dash modifier wasn't merging strokes from strokes that are
unfiltered, resulted in only filtered strokes being shown afterwards.
This fix joins generated strokes with what's left behind so there's no
stroke missing.

Pull Request: https://projects.blender.org/blender/blender/pulls/135705
2025-03-10 12:56:14 +01:00
Lucas
de90eb9c91 Grease Pencil: Reduce size of primary gizmo on line primitives
Reduce size of last endpoint gizmo on line primitives `size_primary` 8.0f
to be the same size of `size_tertiary` 3.0f. Circle and Box primitives are
unchanged as they don't have endpoints and a bigger gizmo doesn't affect
visibility. Motivation for this change is to increase visibility of the endpoint
while drawing since the default is too big for these type of lines and it
blocks the view of it.

Pull Request: https://projects.blender.org/blender/blender/pulls/135658
2025-03-10 12:53:22 +01:00
Julian Eisel
df4345dbaa Fix #135655: Crash when setting Interpolate Sequences curve
The curve widget in the redo popup would sent an undo push which it
shouldn't really. Since 1bde901bf2 such undo pushes will lead to
clearing of the last operation data, which is exactly what the redo
popup displays.

Buttons in operator redo UIs shouldn't send undo pushes. 179169d6c7
disabled them for the "Adjust Last Operation" panel, but not for this
redo popup. In fact there was other code to disable undo for these
buttons, but 2d2f23de10 put this into a wrongly scoped conditional
branch, so it was only executed on the first full redraw.

We can revert 179169d6c7 too now (confirmed already), but I'll do that
separately and not in the release branch.

Confirmed that the following related issues are all (still) fixed with
this:
- #55348
- #134505
- #135655

Pull Request: https://projects.blender.org/blender/blender/pulls/135730
2025-03-10 12:43:43 +01:00
Omar Emara
918e01a61f Merge branch 'blender-v4.4-release' 2025-03-10 13:37:14 +02:00
Omar Emara
c14706e5c9 Fix #135647: Compositor viewer doesn't update on render
Since the introduction of e53ac805af, viewer and previews were not
computed when rendering, because we assumed those would only be useful
during interactive compositing. But we received multiple reports that
this is broken. So users generally expect rendering to compute viewers
and previews.

This patch makes a distinction between background rendering and F12
renders, where the latter computes viewer and previews. This should not
have significant effect on the render time, because typically viewer
results are already computed as part of computing composite results.

Pull Request: https://projects.blender.org/blender/blender/pulls/135723
2025-03-10 12:31:00 +01:00
Campbell Barton
8afa3d662d Merge branch 'blender-v4.4-release' 2025-03-10 22:18:57 +11:00
Campbell Barton
0f13ef0bee Fix potential memory allocation mismatch from struct naming collision
Use anonymous namespace to prevent naming collision allocating
structs of the same name.

Should resolve #134419 although I was unable to redo this bug.

Ref !135726
2025-03-10 22:14:17 +11:00
Falk David
ed01490c28 Merge branch 'blender-v4.4-release' 2025-03-10 12:03:36 +01:00
Philipp Oeser
b0ada86be4 Fix #135710: Grease Pencil: Envelope modifier crash on material influence
Code was reading uninitialized data.

Therefor, initialize two arrays to 0 (since values would only be set for
stuff in curves_mask)

Pull Request: https://projects.blender.org/blender/blender/pulls/135718
2025-03-10 12:03:12 +01:00
Falk David
03347a90a2 Merge branch 'blender-v4.4-release' 2025-03-10 11:08:44 +01:00
Lukas Tönne
6d75a43895 Fix #135689: Grease Pencil: Interpolation crash with single-point curves
In the case of interpolating from a single-point curve to a larger curve
the interpolation tool did not fill the destination indices and factors
arrays, because the "segments" count is zero.

Handle this as a special case to avoid breaking assumptions in the rest
of the sampling code.

Pull Request: https://projects.blender.org/blender/blender/pulls/135720
2025-03-10 11:07:55 +01:00
Falk David
fd19893475 Merge branch 'blender-v4.4-release' 2025-03-10 11:06:52 +01:00
Pratik Borhade
042f8a1dc1 Fix #135606: Grease Pencil: Gesture selection not deselcting when clicking in empty space
Points are actually deselected, but the viewport is not updated.
Set `changed` variable to `true` to send update calls.

Pull Request: https://projects.blender.org/blender/blender/pulls/135708
2025-03-10 11:06:21 +01:00
Falk David
3f4e4963b4 Merge branch 'blender-v4.4-release' 2025-03-10 11:04:08 +01:00
Falk David
785c9c9720 Fix #135273: Grease Pencil: Crash when disabling mutliframe editing
The issue was that the multiframe editing toggle is a tool setting and not
stored in the object data anymore (which was changed in 4.3 so that users
don't have to toggle it in every object).

The batch caches of all Grease Pencils will include the multiframes even
when they are not active.
This leads to the issue that inactive objects don't rebuild their batch cache
when the setting is toggled and we access memory that is out of bounds.

To fix this (for now), toggling the multiframe setting tags all the Grease Pencil
IDs for an update. Obviously this is less than ideal, but the safest option as
of right now.

In the future, we should create a batch cache for each frame.
Then the render engine can request each frame when it's needed,
and we no longer need to tag all the objects for an update when
the setting changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/135636
2025-03-10 11:03:36 +01:00
Clément Foucault
5c2f3a599d Fix #135635: DEG: Legacy Undo breaks viewport update detection
This was cause by the legacy undo recreating the depsgraph for
every update.
Depsgraph is recreated for each undo step which make the update
counter stay at 1. The fix is to protect for this case using a
global atomic counter.
2025-03-10 11:00:07 +01:00
Falk David
de66b84e53 Merge branch 'blender-v4.4-release' 2025-03-10 10:53:29 +01:00
YimingWu
df942ecaca Fix #135607: Grease Pencil: Auto keying not working when using trim tool
Auto key support was missing. This PR implmented this feature
back so it's consistent with what we have in Blender 4.2.

Pull Request: https://projects.blender.org/blender/blender/pulls/135609
2025-03-10 10:53:01 +01:00
Omar Emara
8ade574b9f Shading: Retain alpha in Mix Color shader code
The Mix Color shader node does not retain the alpha channel of the first
input in both the Linear Light and Soft Light modes, while it is retain
for other modes. Further, result clamping also ignores the alpha due to
using the vector clamp function, which introduces implicit conversion
that removes the alpha.

This does not matter for EEVEE because it does nothing with the alpha
channel. But the code will now be shared with the compositor, which does
care about the alpha channel. So adjust the code accordingly to retain
the alpha in those cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/135632
2025-03-10 09:36:44 +01:00
Jeroen Bakker
ba22e5e6be Merge branch 'blender-v4.4-release' 2025-03-10 08:49:37 +01:00
Jeroen Bakker
40696ca452 SubDiv: Migrate GPU subdivision to use GPU module
Blender already had its own copy of OpenSubDiv containing some local fixes
and code-style. This code still used gl-calls. This PR updates the calls
to use GPU module. This allows us to use OpenSubDiv to be usable on other
backends as well.

This PR was tested on OpenGL, Vulkan and Metal. Metal can be enabled,
but Vulkan requires some API changes to work with loose geometry.

![metal.png](/attachments/bb042c3a-1a87-4140-9958-a80da10d417b)

# Considerations

**ShaderCreateInfo**

intern/opensubdiv now requires access to GPU module. This to create buffers
in the correct context and trigger correct dispatches. ShaderCreateInfo is used
to construct the shader for cross compilation to Metal/Vulkan. However opensubdiv
shader caching structures are still used.

**Vertex buffers vs storage buffers**

Implementation tries to keep as close to the original OSD implementation. If
they used storage buffers for data, we will use GPUStorageBuf. If it uses vertex
buffers, we will use gpu::VertBuf.

**Evaluator const**

The evaluator cannot be const anymore as the GPU module API only allows
updating SSBOs when constructing. API could be improved to support updating
SSBOs.

Current implementation has a change to use reads out of bounds when constructing
SSBOs. An API change is in the planning to remove this issue. This will be fixed in
an upcoming PR. We wanted to land this PR as the visibility of the issue is not
common and multiple other changes rely on this PR to land.

Pull Request: https://projects.blender.org/blender/blender/pulls/135296
2025-03-10 07:31:59 +01:00
Jeroen Bakker
eceb81b21f GPU: Remove RDNA2 shader viewport workaround
It has been confirmed that the latest release of AMD drivers has fixed
issues for both OpenGL and Vulkan. Users should use AMD driver 25.3.1
or later. Removing the workaround as it has performance penalties on
RDNA2 based GPUs.

Reference: #135516
Pull Request: https://projects.blender.org/blender/blender/pulls/135630
2025-03-10 07:22:02 +01:00
Campbell Barton
e4f1ceacad Merge branch 'blender-v4.4-release' 2025-03-10 17:19:52 +11:00
Campbell Barton
c1d92cb014 Cleanup: quiet unused variable warning 2025-03-10 17:18:30 +11:00
YimingWu
b7634119c6 Merge branch 'blender-v4.4-release' 2025-03-10 11:35:52 +08:00
YimingWu
e781bd7e11 Fix #135439: Grease Pencil: Prevent deleting groups with animated visibility
Previously in 6f80d722c6 there was a fix for
not removing layers from evaluated data when their visibility is animated,
however it overlooked that the same thing could happen to layer groups.
This fix basically duplicated the same check for layer groups.

Pull Request: https://projects.blender.org/blender/blender/pulls/135450
2025-03-10 04:29:15 +01:00
Hans Goudey
7cd1c2c7b6 Cleanup: Use reference to fill MeshRenderData
Mainly to make a future diff smaller (MeshRenderData will
no longer be allocated on the heap).
2025-03-08 10:59:02 -05:00
Germano Cavalcante
6aeda6edaa Merge remote-tracking branch 'origin/blender-v4.4-release' 2025-03-08 10:19:49 -03:00
Germano Cavalcante
bd9dce74c0 Fix #135564: 'Cycle edges' on the Knife tool not working
Due to recent code changes, `knife_calculate_snap_ref_edges` relied on
the (not yet computed) `kcd->curr.mval` to compute the raycast ray.

The solution is to pass the computed ray right before.

Also `knife_snap_update_from_mval` is now called on the modal to update
the edge as soon as the button is pressed.

Pull Request: https://projects.blender.org/blender/blender/pulls/135649
2025-03-08 14:16:34 +01:00
Hans Goudey
a5d1aecbc3 Merge branch 'blender-v4.4-release' 2025-03-07 12:50:29 -05:00
Hans Goudey
3f87120ccf Fix #135633: Freeze/crash using a specific Geometry Node group as modifier
`interface_input_index` was called for an output socket. Also filter out inputs
that aren't exposed in the modifier, similar to a few lines above.

Pull Request: https://projects.blender.org/blender/blender/pulls/135641
2025-03-07 18:46:53 +01:00
Hans Goudey
99fa22a01f Fix #135175: Bounds overlay doesn't include all evaluated geometry
In the report, the bounds didn't include the curves generated from the
original legacy curve object. Generally we need to access the evaluated
geometry bounds here when the object is a geometry object.

This depends on 06f6d77979 for consistent behavior with
curve radii. That's why the fix is limited to main rather than 4.4.

Pull Request: https://projects.blender.org/blender/blender/pulls/135639
2025-03-07 18:23:40 +01:00
Hans Goudey
0461e4b8e4 Cleanup: Improve documentation for Object bounds functions 2025-03-07 12:20:39 -05:00
Campbell Barton
967fb3ae4c Fix: Grease Pencil: Crash running operators that require a 3D viewport
Correct the poll functions for reproject & texture gradient.

Pull Request: https://projects.blender.org/blender/blender/pulls/135618
2025-03-07 18:13:20 +01:00
Hans Goudey
8e4b34cad0 Cleanup: Remove unnecessary "else" after "continue" 2025-03-07 12:06:50 -05:00
Philipp Oeser
711772de88 Merge branch 'blender-v4.4-release' 2025-03-07 17:59:33 +01:00
Hans Goudey
59b6212fed Geometry Nodes: Avoid logging entire long strings
To avoid overhead from logging, don't log more than 100 characters.

Pull Request: https://projects.blender.org/blender/blender/pulls/135592
2025-03-07 17:54:26 +01:00
Philipp Oeser
a568890515 Fix #135601: prop_tabs_enum No Longer Displays Text of Enum
Caused by 21aef81714

Now, pass along `uiname` as `std::optional<StringRef>` early on (and use
`std::nullopt`).

Without this, the `(!uiname || !uiname->is_empty())` condition in
`ui_item_enum_expand_elem_exec` wont be true, resulting in the empty
label.

Pull Request: https://projects.blender.org/blender/blender/pulls/135621
2025-03-07 17:53:54 +01:00
Philipp Oeser
62fcd012cf Fix #135582: Crash box selecting in sequence editor without a sequence
Caused by f98b01e492

The issue of uninitialized `Editing` (in new scenes) has come up before,
see e.g. https://projects.blender.org/blender/blender/issues/
118633#issuecomment-1134447

So it is not uncommon to guard against `Editing` being null, same is now
done here

Pull Request: https://projects.blender.org/blender/blender/pulls/135623
2025-03-07 17:53:43 +01:00
Philipp Oeser
8beb695b7f Fix #135625: Grease Pencil: Unavailable Masks operators not grayed out
To resolve, add proper poll functions checking the needed amount of
masks.

Pull Request: https://projects.blender.org/blender/blender/pulls/135629
2025-03-07 17:53:30 +01:00
Hans Goudey
06f6d77979 Curves: Fix bounding box ignores radius, add option to geometry node
Unlike the legacy type, the radius isn't included in the bounds for the new
curves type. This hasn't been obvious because the drawing is quite broken
and doesn't use the radius properly.

This commit adds a separate cache for the bounds with the radius, which
is now used by default. The old cache is kept around for backward
compatibility in the bounding box geometry node, where a new
"Use Radius" option accesses the old behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/135584
2025-03-07 17:38:29 +01:00
Hans Goudey
3f596a651c Geometry Nodes: Add names to String to Curves instance geometries
The name of each instance geometry is the character. This makes debugging
in the spreadsheet much easier, and the objects from "Visual Geometry to Objects"
are actually usable too.

Pull Request: https://projects.blender.org/blender/blender/pulls/135599
2025-03-07 17:01:18 +01:00
Falk David
39ceab03be Merge branch 'blender-v4.4-release' 2025-03-07 16:23:53 +01:00
Falk David
a904d3a1b2 Fix #135539: Grease Pencil: Depth placement not working in rendered mode
The issue was happening because the `is_render_depth_available`
state flag was false leading to the depths being cleared.

When we use `is_depth_only_drawing`, we expect
that the depth is valid because the Grease Pencil
engine will write them.

Pull Request: https://projects.blender.org/blender/blender/pulls/135619
2025-03-07 16:17:15 +01:00
Bastien Montagne
015790964d Cleanup: WM: Replace 'void' MEM_[cm]allocN with templated, type-safe MEM_[cm]allocN<T>.
The main issue of 'type-less' standard C allocations is that there is no check on
allocated type possible.

This is a serious source of annoyance (and crashes) when making some
low-level structs non-trivial, as tracking down all usages of these
structs in higher-level other structs and their allocation is... really
painful.

MEM_[cm]allocN<T> templates on the other hand do check that the
given type is trivial, at build time (static assert), which makes such issue...
trivial to catch.

NOTE: New code should strive to use MEM_new (i.e. allocation and
construction) as much as possible, even for trivial PoD types.

Pull Request: https://projects.blender.org/blender/blender/pulls/135626
2025-03-07 15:52:34 +01:00
Germano Cavalcante
7688677e29 Refactor: DRW: Replace 'DRW_draw_depth_object' with 'DRW_draw_depth_loop'
`DRW_draw_depth_object` seems completely out of spec (using DRW batches
to draw onto non-DRW framebuffer + no DST setup).

Pull Request: https://projects.blender.org/blender/blender/pulls/135598
2025-03-07 13:47:09 +01:00
YimingWu
308e81fd8a Fix #135438: Prevent vertex group name collision when renaming bones.
When renaming bones, vertex groups that has the same name as the old
name of the bone will be renamed to the new name, but this may cause
name collision in the vertex group list. When this happens, we should
not change the vertex group's name. Now a warning message will show.

Pull Request: https://projects.blender.org/blender/blender/pulls/135492
2025-03-07 12:52:09 +01:00
Bastien Montagne
09221e4db2 Cleanup: Creator: Replace 'void' MEM_[cm]allocN with templated, type-safe MEM_[cm]allocN<T>.
The main issue of 'type-less' standard C allocations is that there is no check on
allocated type possible.

This is a serious source of annoyance (and crashes) when making some
low-level structs non-trivial, as tracking down all usages of these
structs in higher-level other structs and their allocation is... really
painful.

`MEM_[cm]allocN<T>` templates on the other hand do check that the
given type is trivial, at build time (static assert), which makes such issue...
trivial to catch.

NOTE: New code should strive to use `MEM_new` (i.e. allocation and
construction) as much as possible, even for trivial PoD types.

Pull Request: https://projects.blender.org/blender/blender/pulls/135620
2025-03-07 11:52:12 +01:00