Commit Graph

120055 Commits

Author SHA1 Message Date
Jacques Lucke
1fca4e7f87 Cleanup: quiet warnings for using deprecated sequencer properties 2025-03-31 18:59:26 +02:00
Clément Foucault
9181485931 Fix #136235: Edit UV: Crash when modifying mesh in shaded viewport
This happened because the viewport was drawn after
the UV editor when some update occur (e.g. canceling an
operator). The requested UV edit batch would require only
one specific UV channel. The viewport, in need of a different
UV channel, requested a VBO rebuild (freing the old UV VBO)
but did not correctly clear the UV batches that were referencing
the said VBO. This lead to use after free which would sometime
works because the same memory would be reused for a random new
batch.

Pull Request: https://projects.blender.org/blender/blender/pulls/136780
2025-03-31 18:45:59 +02:00
Guillermo Venegas
69a7c834b8 Refactor: UI: Use typed enum class for uiItemInternalFlag enum
Part of incoming refactors in interface layout C++ code, this enables
forward declaring this enum type outside of `layout_interface.cc`. The
enum is renamed as `ItemInternalFlag` and moved to the `blender::ui`
namespace. `uiItemInternalFlag` is preserved as a shorthand for
`blender::ui::ItemInternalFlag`.
No user visible changes expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/136782
2025-03-31 18:23:16 +02:00
Jacques Lucke
2522f88bba Cleanup: quiet false positive dangling reference warning
I get a warning in a bunch of places where `library_ensure_catalogs_in_path` is
called. This is a known false positive of GCC. To workaround the warning, the
`AssetCatalogPath` can be constructed in a separate statement to avoid
implicitly constructing it as temporary value when calling
`library_ensure_catalogs_in_path`.

Pull Request: https://projects.blender.org/blender/blender/pulls/136762
2025-03-31 17:55:35 +02:00
Miguel Pozo
8f63f509b6 Fix #136501: Overlay: Edit Mode Edges occluded by viewport grid
Render Overlay Meshes after the Grid.
As a side effect, in-front wireframe objects are now displayed behind
non-in-front edit mode overlays.

Co-authored-by: Clément Foucault
Pull Request: https://projects.blender.org/blender/blender/pulls/136764
2025-03-31 17:37:00 +02:00
Hans Goudey
ef86d9fe86 Cleanup: Remove ED_ prefix from private functions 2025-03-31 11:21:24 -04:00
Jeroen Bakker
3ad5721a1c Fix #136767: SubDiv: Incorrect attribute interpolation
177bbf12df solved the out of bound read
by limiting the input search. However this lead to incorrect
interpolation. This has been fixed by moving the bound check as a
post check.

Pull Request: https://projects.blender.org/blender/blender/pulls/136769
2025-03-31 15:43:01 +02:00
Guillermo Venegas
ba85f96f7a Refactor: UI: Use typed enum class for uiItemType enum
Part of incoming refactors in interface layout C++ code, this enables
forward declaring this enum type outside of `layout_interface.cc`. The
enum is renamed as `ItemType` and moved to the `blender::ui` namespace.
`uiItemType` is preserved as a shorthand for `blender::ui::ItemType`.
No user visible changes expected, layout introspection will still print
item types using property enum identifier format.

Pull Request: https://projects.blender.org/blender/blender/pulls/136740
2025-03-31 15:30:58 +02:00
Hans Goudey
571d1c5f23 Fix #136668: Curve to mesh potential crash with fill caps
Different areas of this code were using different checks for whether a
specific curve combination has caps or not. Extract the check to a separate
function to avoid that problem.
2025-03-31 09:28:30 -04:00
Hans Goudey
c7def2bb5e Revert "Fix #136668: Curve to mesh crash with fill caps and no faces in output"
This reverts commit a1c3771492.

This fix didn't address the core issue.
2025-03-31 09:28:30 -04:00
Sybren A. Stüvel
6b62ec5b3a Fix #136736: Pasting keyframes broken when action groups are collapsed
Fix an issue where copy-paste of keyframes was broken when action groups
are collapsed. It was caused by the `ANIMFILTER_LIST_VISIBLE` filter
flag; removing it (as it was before the bug-introducing commit) resolved
the problem.

Pull Request: https://projects.blender.org/blender/blender/pulls/136768
2025-03-31 15:13:04 +02:00
Jorn Visser
b1bb1d9815 Build: Make the FFTW threads library required to use FFTW
This is done because the library is necessary to make certain FFTW
functions thread safe, see #136557 as well.

Also pass each library variable separately to
`find_package_handle_standard_args` instead of as a list, as otherwise
it won't correctly detect if `libfftw3f` or `libfftw3f_threads` is
missing. This is because CMake considers a value false if it contains
`-NOTFOUND` at the end, but not if it's in the middle. For example,
CMake considers
`.../libfftw3f.a;.../libfftw3f_threads.a;FFTW3_LIBRARY_D-NOTFOUND` to be
false, but
`.../libfftw3f.a;FFTW3_LIBRARY_THREADS_F-NOTFOUND;.../libfftw3.a` to be
true.

---

I noticed that some other find modules also have the same list issue. I guess it was done this way to make CMake print all the found libraries instead of only the first.

Pull Request: https://projects.blender.org/blender/blender/pulls/136692
2025-03-31 14:42:35 +02:00
Falk David
0b2ba603d1 Fix: Node Tools: Crash in debug build using Selection node
The Selection node was creating a boolean field for a float
socket causing an assert to be hit in a debug build.

Pull Request: https://projects.blender.org/blender/blender/pulls/136766
2025-03-31 14:28:09 +02:00
Jeroen Bakker
ee8e993181 Fix #136237: Limit max material index to MAXMAT
Due to !133498 layers containing incorrect material indices could lead to generating
to many GPU resources crashing Blender. As there is a maximum number of material slots
we can limit it.

This is just a safeguard for incorrect values in material_index attribute layer. Working with
this material index attributes should automatically limit, but I leave that to the modeling
module.

Pull Request: https://projects.blender.org/blender/blender/pulls/136302
2025-03-31 13:24:39 +02:00
Aras Pranckevicius
a2ffdb74b4 Fix #136651: H265 output not compatible with Apple (Quicktime/FCP)
As per https://trac.ffmpeg.org/wiki/Encode/H.265
the video needs to have a special `hvc1` tag to be set, in order
for it to be understood by Apple products.

Pull Request: https://projects.blender.org/blender/blender/pulls/136756
2025-03-31 13:16:26 +02:00
Philipp Oeser
48f2028687 Fix #136728: Motion path keyframe number not showing on bones
This was only working if one had  `+ Non-Grouped Keyframes` enabled.So
code wasnt finding the bone name in the groups of the Action.That in
turn was caused by the fact that `animviz_calc_motionpaths` solely uses
`BKE_action_group_find_name` [which is documented to support only legacy
Actions].

To resolve, check if the action is legacy, otherwise get the
`Channelbag` and use its `channel_group_find`

Pull Request: https://projects.blender.org/blender/blender/pulls/136757
2025-03-31 12:42:02 +02:00
Jeroen Bakker
5a5471b622 Python: Add GPUShaderCreateInfo.depth_write method
Setting depth_write option of ShaderCreateInfo isn't available in
python GPU module. This PR adds support of it.

References #136732

Pull Request: https://projects.blender.org/blender/blender/pulls/136752
2025-03-31 12:37:56 +02:00
ChengduLittleA
d8167b14a7 Fix #136755: Grease Pencil: Prevent "Merge Group" run on empty groups
Similar to https://projects.blender.org/blender/blender/pulls/136652,
"Merge Group" also need to check whether there are actual layers inside
the active group, otherwise it can't merge.

Pull Request: https://projects.blender.org/blender/blender/pulls/136760
2025-03-31 12:36:16 +02:00
Jeroen Bakker
5e26f5cc2a Vulkan: Reduce lag on certain platforms.
After reviewing the locations where `GPU_flush()` are used it doesn't seem
to be harmfull to include these for the Vulkan backend as well. Hopefully
will save some lag that can happen when submitting one huge render graph.

Improved playback of rain_restaurant.blend where frames could be dropped
resulting into UI lag.

Pull Request: https://projects.blender.org/blender/blender/pulls/136654
2025-03-31 12:16:48 +02:00
Falk David
47d1d36dc4 Cleanup: Grease Pencil: Move apply_eval_grease_pencil_data function
Moves the `apply_eval_grease_pencil_data` function
to `grease_pencil_utils.cc` in the `ed::greasepencil` namespace.
2025-03-31 12:06:45 +02:00
Anthony Roberts
5dfb005cd0 Windows ARM64: GPU Subdivision: Re-enable on Qualcomm GPUs
In light of recent changes by Jeroen, #124515 seems to have been resolved properly, rather then using this workaround.

This also sidesteps the issue seen in #136633 which only happens when GPU sibdiv is disabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/136678
2025-03-31 11:44:50 +02:00
Pratik Borhade
bf4418bc8d Fix #136646: Grease Pencil: Interpolate crash when layer is not active
Check whether active layer node exists to prevent the crash (eg.
attached file from the report or when group node is active)

Pull Request: https://projects.blender.org/blender/blender/pulls/136649
2025-03-31 11:15:23 +02:00
Clément Foucault
cf0982d308 Cleanup: Grease Pencil: Merge Vfx methods into instance class
_No response_

Pull Request: https://projects.blender.org/blender/blender/pulls/136696
2025-03-31 10:33:29 +02:00
Guillermo Venegas
6397a4fb9a Refactor: UI: Use typed enum class for eUIEmbossType enum
Part of incoming refactors in interface layout c++ code, this enables
forward declaring this enum type. Enum is renamed as `EmbossType` and
moved to `blender::ui` namespace. No user visible changes expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/136725
2025-03-31 00:36:46 +02:00
Campbell Barton
6f5a466f29 Fix: avoid potential null pointer dereference for the last handled event
The previous value had already been copied.
2025-03-29 19:48:56 +11:00
Campbell Barton
be4028f93f Cleanup: remove redundant null checks 2025-03-29 19:41:08 +11:00
Pratik Borhade
6bab76ed38 Fix: Grease Pencil: Merge all crash in empty list
Calling `merge all` operation in an empty list triggers the crash. Check
node size before further evaluation to prevent the crash

- Add GP object
- Remove all layers
- Execute `Merge All` operation

Pull Request: https://projects.blender.org/blender/blender/pulls/136652
2025-03-29 08:48:51 +01:00
Campbell Barton
e40a01ead0 License header: add missing SPDX header 2025-03-29 15:24:57 +11:00
Campbell Barton
aa4f717b41 Docs: add missing \file blocks to blenlib & blenkernel 2025-03-29 15:18:50 +11:00
Campbell Barton
f43b8afdd7 Cleanup: move sync-select checks into uv_select_* functions
uv_select_all_perform had split the UV_SYNC_SELECTION
case into a separate block which complicated changes in this area.

Now each UV select function handles the sync-select case.

Also make UV's const when only used for comparison.
2025-03-29 14:51:17 +11:00
Sean Kim
61c04ba83a Cleanup: Add type aliases for Multires and Dyntopo neighbor vectors
Pull Request: https://projects.blender.org/blender/blender/pulls/136701
2025-03-29 02:56:45 +01:00
Sean Kim
c5cda9474e Fix #136637: Voxel remesh crashes with small input
Caused by 6c05859b12

OpenVDB does not handle transformations with determinants smaller than
3e-15 and throws an `ArithmeticError` when a `Transform` is created
with invalid values.

To avoid abrupt crashes on the user side, this commit catches the error
and displays a warning message.

Pull Request: https://projects.blender.org/blender/blender/pulls/136690
2025-03-29 02:52:00 +01:00
Hans Goudey
730d0dfc0c Cleanup: Fix constexpr for StringRefNull c-string constructor
Similar to c4d5145070.
2025-03-28 21:10:42 -04:00
Campbell Barton
12e3a046a5 Cleanup: remove unused defines 2025-03-29 11:49:08 +11:00
Campbell Barton
1ad24979f7 Cleanup: correct begin/end macro use 2025-03-29 11:37:21 +11:00
Harley Acheson
13ef69dc6c UI: Remove Frame Stalk When Timelines Minimized
When various timeline-like editors are minimized to header size, also
remove the vertical stalk under the current frame indicator.

Pull Request: https://projects.blender.org/blender/blender/pulls/136698
2025-03-29 00:07:04 +01:00
Cartesian Caramel
ade8576bf7 Geometry Nodes: new Camera Info Node
This adds a new Camera Info node to Geometry Nodes. It provides information
about the passed in camera like its projection matrix and focus distance.

This can be used for camera culling which was must more complex before.
It also allows building other view-dependent effects.

Pull Request: https://projects.blender.org/blender/blender/pulls/135311
2025-03-28 22:54:13 +01:00
Jacques Lucke
98c4d107ea Fix: BLI_str_endswith returns false when both inputs are the same
Found this while reviewing #136021. It's somewhat surprising that this didn't cause issues before.

This patch also adds some unit tests for `BLI_str_endswith` and `BLI_str_startswith`.

Pull Request: https://projects.blender.org/blender/blender/pulls/136679
2025-03-28 22:48:26 +01:00
Jacques Lucke
29fddf4710 Python: Geometry: create GeometrySet wrapper for Python
In Geometry Nodes a geometry is represented by a `GeometrySet`. This is a
container that can contain one geometry of each of the supported types (mesh,
curves, volume, grease pencil, pointcloud, instances). It's possible for a
`GeometrySet` to contain e.g. a mesh and a point cloud.

This patch creates a Python  wrapper for the built-in `GeometrySet`. For now,
it's main purpose is to consume the complete evaluated geometry of an object
without having to go through complex hoops via `depsgraph.object_instances`. It
also also allows retrieving instances that have been created with legacy
instancing systems such as dupli-verts or particles.

In the future, the `GeometrySet` API could also be used for more kinds of
geometry processing from Python, similar to how we use `GeometrySet` internally
as generic geometry storage.

Since we can't really have constness guarantees in Python currently, it's
enforced that the `GeometrySet` wrapper always has its own copy of each geometry
type (so e.g. it does not share a `Mesh` data-block pointer with any other place
in Blender). Without the copy, changes to the mesh in the geometry set would
also affect the evaluated geometry that Blender sees. The copy has a small cost,
but typically the overhead should be low, because attributes and other run-time
data can still be shared. This should be entirely thread-safe, assuming that no
code modifies implicitly shared data, which is forbidden. For historic reasons
there are still cases like #132423 where this assumption does not hold in all
cases. Those cases should be fixed. To my knowledge, this patch does not
introduce any new such issues or makes existing issues worse.

Pull Request: https://projects.blender.org/blender/blender/pulls/135318
2025-03-28 22:40:01 +01:00
Sean Kim
2ad17b956a BLI: Add rolling average support to ScopedTimerAverage
Adds a new argument for the class constructor as well as a new macro to
support printing the rolling average of a number of samples intead of
the total average.

This can be useful for getting a sample of an average durations in
functions that are continually running, e.g. the main event loop.

Pull Request: https://projects.blender.org/blender/blender/pulls/136530
2025-03-28 22:28:59 +01:00
Hans Goudey
ebe7259c65 Fix #136670: Missing update after UV editor selection
Typo in 9b70851d91.
2025-03-28 16:01:21 -04:00
Hans Goudey
a1c3771492 Fix #136668: Curve to mesh crash with fill caps and no faces in output 2025-03-28 15:03:45 -04:00
Brecht Van Lommel
149df31242 Fix #136633: Missing edit mode select update when GPU subdivision disabled
Apply batch cache updates to subdivided mesh.

Pull Request: https://projects.blender.org/blender/blender/pulls/136684
2025-03-28 20:02:10 +01:00
Hans Goudey
ec2cdce657 Fix #136625: Crash switching to Texture Paint workspace
Simple mistake in 9b70851d91.
The batch creation info wasn't moved to the vector, so nothing happened;
it was never created.
2025-03-28 14:47:44 -04:00
Hans Goudey
ffef093c25 Cleanup: Draw: Remove unused mesh buffer list defines 2025-03-28 14:47:44 -04:00
Hans Goudey
448d3d04d9 Cleanup: Unify and clean up mesh transform & translation functions
Use C++ types, move to C++ header, use them consistently in the
geometry transform function.
2025-03-28 11:36:39 -04:00
Brecht Van Lommel
ac5dc94c40 Fix #136619: Stereo image saving has wrong colorspace
The logic about which buffer it's going to use for saving is quite confusing.
This simply restores the logic from before 7584ccc28d while still guarding
against accessing null buffers.

Pull Request: https://projects.blender.org/blender/blender/pulls/136659
2025-03-28 13:58:03 +01:00
Jacques Lucke
c42249705b Cleanup: move subdiv levels to end of mesh info when printing GeometrySet 2025-03-28 12:54:18 +01:00
Leon Schittek
2204d1308d Fix: Grease Pencil: Crash when exporting PDF/SVG with sampling
The selection and lengths for the resampling of the outline were based
on the original curves rather than the generated outline curves causing
out of bounds access.

---

#### Problem
Exporting grease pencil objects and setting the "Sampling" option
to higher than 0.0 will cause a crash during export.

In a debug build the following assert is triggert:

```
BLI_assert failed: C:\Users\leons\dev\blender-git\blender\source\blender\blenlib\BLI_virtual_array.hh:625, operator [](), at 'index < this->size()'
```

##### Steps to reproduce the issue

1. Open the attached .blend file: [gp-export-resample-crash.blend](/attachments/3be6839f-3376-4d75-ad54-077f1eeab472)
2. Select the "Monkey" grease pencil object and export it as PDF or SVG
3. In the export dialog set the "Sampling" to something other than `0.0` e.g. `0.2`
4. Confirm.
5. Blender should crash.

Pull Request: https://projects.blender.org/blender/blender/pulls/136585
2025-03-28 11:20:18 +01:00
Jacques Lucke
456e28df17 Fix: Nodes: wrong placeholder in some data-block sockets
For some socket types, the placeholder was showing the type of the socket instead
of the socket label.

Pull Request: https://projects.blender.org/blender/blender/pulls/136634
2025-03-28 11:10:29 +01:00