Commit Graph

118093 Commits

Author SHA1 Message Date
Falk David
3bbf7aed91 Merge branch 'blender-v4.4-release' 2025-03-10 16:14:37 +01:00
Philipp Oeser
1f780a5caa Fix #135711: Setting Grease Pencil modifier materials are not refcounted
When setting these materials, then removing the modifier, usercount
would be decreased, resulting in possible dataloss on reload

Affected were:
- all Grease Pencil modifiers material influence materials
- `LineartModifier` `target_material`
- `OutlineModifier`  `outline_material`

These were all using `IDWALK_CB_USER` which ends up decrementing
usercount in `modifier_free_data_id_us_cb` when the modifier is removed

So to resolve, decrement/increment material usercount in
`rna_GreasePencilModifier_material_set` appropriately

NOTE: previously, it was also doing `id_lib_extern` on the object?!
(should be on the material, no?)

NOTE: still not 100% sure where we actually use refcounting (esp. in
modifiers) and where we dont, another alternative is to just drop it and
use IDWALK_CB_NOP` (instead of `IDWALK_CB_USER`) for these materials.

Pull Request: https://projects.blender.org/blender/blender/pulls/135729
2025-03-10 16:12:32 +01:00
илья _
b0dfc90368 Cleanup: Geometry Nodes: Better use of BLI functions
There is a `mod_periodic` function which is equivalent to
`apply_offset_in_cyclic_range` but more general.
Also there is a side cleanup of the naming.

Pull Request: https://projects.blender.org/blender/blender/pulls/135667
2025-03-10 16:10:12 +01:00
Anthony Roberts
5a029fdf1f Merge branch 'blender-v4.4-release' 2025-03-10 14:42:18 +00:00
Pratik Borhade
07c38e5612 Fix #135290: NLA move channel crash when Grease Pencil object data animation is present
Crash occurs due to channeltype ANIMTYPE_GREASE_PENCIL_DATABLOCK added
to the filtered list when rearranging nla strips. This channel seems
unnecessary, it has caused crashes in past as well (d943c9f128). Animation data
on object other than drawing-keys are already handled by `animfilter_block_data`.

Pull Request: https://projects.blender.org/blender/blender/pulls/135375
2025-03-10 14:56:11 +01:00
Falk David
15d71a02ff Merge branch 'blender-v4.4-release' 2025-03-10 14:55:02 +01:00
YimingWu
d443932c73 Fix #135728: Grease Pencil: Correct point count in length modifier
In Grease Pencil length modifier, if a stroke is not filtered, it
may not have a valid point count/offset. This fix ensures that we
get valid point count by copying it beforehand.

Pull Request: https://projects.blender.org/blender/blender/pulls/135733
2025-03-10 14:54:28 +01:00
Sybren A. Stüvel
657f9e45f7 Merge remote-tracking branch 'origin/blender-v4.4-release' 2025-03-10 14:52:14 +01:00
Sybren A. Stüvel
955e02c90d Fix: Duplicating a Scene does not remove animation from slotted actions
When duplicating a scene in any way other than Full Copy, the VSE data
is (apparently) not copied along. To prevent dangling F-Curves, any
animation of sequencer strips is removed. This is now done correctly for
slotted Actions, instead of looping over the legacy `action->curves`
field.

Also the F-Curve RNA path that's being tested for is updated. Instead of
deleting all F-Curves with `sequences` in the name, the code now
correctly looks for `sequence_editor.strips_all`.

Pull Request: https://projects.blender.org/blender/blender/pulls/135576
2025-03-10 14:49:12 +01:00
Sybren A. Stüvel
216964c697 Fix: Crash when scene has F-Curves for VSE sequencer strips, but no VSE
Fix a crash when the Scene's Action has F-Curves targeting the VSE
sequencer strips, but the scene has no VSE data at all.

This issue occurs in the following way:

- Scene uses VSE, with an animated strip.
- Duplicate the scene using Linked Copy. This does _not_ copy the VSE
  into the duplicate scene, but does include its animation (due to a bug
  for which a fix is coming).
- Ensure the Dope Sheet is visible & showing the scene animation.

Pull Request: https://projects.blender.org/blender/blender/pulls/135576
2025-03-10 14:49:03 +01:00
Hans Goudey
0c19528199 Merge branch 'blender-v4.4-release' 2025-03-10 09:33:08 -04:00
Hans Goudey
c52da69dfb Fix #135643: Node ungroup operator doesn't move frame nodes
Caused by 4bf34d9591.

Nodes within frames were ignored because previously their location was
relative to the frame, so moving both the frame and the node would cause
"double" movement. Now each node location is independent.
2025-03-10 09:32:12 -04:00
Clément Foucault
92df5ba10f Fix #135650: Workbench: Missing update changing shading pop-over settings
This was previously taken care of by the `view_update` callback.
Nowadays, the best way is to manually check for changes inside
the engine.
2025-03-10 13:34:41 +01:00
Clément Foucault
86d7f1bcee Merge branch 'blender-v4.4-release' 2025-03-10 13:07:47 +01:00
Clément Foucault
690a165630 Fix #135652: Overlay: Overlays draw in front of mesh in Paint modes
This was caused by a missing prepass.
Only early out if drawing the prepass, otherwise, run all checks.
This is much safer.
2025-03-10 13:07:35 +01:00
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