Commit Graph

118587 Commits

Author SHA1 Message Date
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
Campbell Barton
5d232486e6 Cleanup: minor clarifications in doc-strings for NDOF & OSKEY 2025-03-28 14:06:36 +11:00
Campbell Barton
38d9d971e5 WM: add a "Hyper" capability flag
Avoids the need to check against ghost backends.
2025-03-28 13:46:39 +11:00
Campbell Barton
894dca7f76 UI: correct the keymap editor to match the OSKEY label to the platform 2025-03-28 13:26:09 +11:00
Campbell Barton
46bfd3196d Cleanup: match wmEvent::modifier type for uiButHotkeyEvent::modifier_key 2025-03-28 01:58:11 +00:00
Pratik Borhade
28704a47a1 Fix #136157: UI: Eyedropper tooltip remains visible in non-active space
When mouse is moved from one area to other of same spacetype, previous
region is not redrawn. This results in tooltip being stuck at the edge of
previous area. In such case, send a redraw call to that region.

Pull Request: https://projects.blender.org/blender/blender/pulls/136168
2025-03-28 02:03:44 +01:00
Campbell Barton
b252a6c7fb Cleanup: various non-functional changes for C++ 2025-03-28 00:59:15 +00:00
Campbell Barton
69682c78f2 Cleanup: pass values by const reference 2025-03-28 00:59:13 +00:00
Campbell Barton
90287acff2 Cleanup: remove redundant null checks
Use references instead of pointers when assigning values from struct
members, then remove the null check.
2025-03-28 00:59:12 +00:00
Campbell Barton
12e17e2477 Cleanup: use const arguments, variables 2025-03-28 00:59:11 +00:00
Campbell Barton
460a05cbbc Cleanup: match declaration names 2025-03-28 00:59:09 +00:00
Sean Kim
25b6cecbb1 Cleanup: Consolidate symmetry iteration check
Removes the `SCULPT_` prefixed version and moves the function into
`paint_intern.hh` as it is shared across all mesh painting types
that support symmetry.

Pull Request: https://projects.blender.org/blender/blender/pulls/136638
2025-03-28 00:49:45 +01:00
Brecht Van Lommel
a02e0fa147 Refactor: Improve image buffer save/load function names and arguments 2025-03-27 22:07:51 +01:00
Brecht Van Lommel
124c0f1692 OpenColorIO: Support using file rules to detect colorspace
The Blender config.ocio does not have any rules, but custom ones can.

The default file rule is ignored if default_byte or default_float roles
exist. These roles are Blender specific, so would not be found in a typical
OCIO config. But when they are set appropriately, they help provide better
default guesses than what is possible with standard OCIO rules.

Pull Request: https://projects.blender.org/blender/blender/pulls/136516
2025-03-27 22:07:50 +01:00
Brecht Van Lommel
ccd7bc2078 Refactor: Modify colorspace handling for image buffer reading
The file formats now fill in ImColorSpaceInfo with the metadata colorspace
and a boolean saying if the pixels have HDR colors. And then the actual
colorspace is decided in imb_handle_colorspace_and_alpha.

This centralizes the logic in one place to make it possible to add
OpenColorIO file rules.

Pull Request: https://projects.blender.org/blender/blender/pulls/136516
2025-03-27 22:07:50 +01:00
Brecht Van Lommel
c225772735 Refactor: Initialize IMB module for image test
Needed for future changes, surprising that it worked without.

Pull Request: https://projects.blender.org/blender/blender/pulls/136516
2025-03-27 22:07:50 +01:00
Richard Antalik
972fda1a7d Cleanup: Refactor VSE effect input get function
Function `strip_effect_get_new_inputs` contained selection parsing and
error handling. It also returned values by setting 3 pointer addresses.

Split function to selection parsing which returns strips in container
and validation function, which returns error string if selection is not
valid. If selection is valid, empty string is returned

Pull Request: https://projects.blender.org/blender/blender/pulls/136474
2025-03-27 22:02:38 +01:00
Jacques Lucke
8b1add3346 Refactor: Geometry Nodes: support retrieving geometry set without applying subdiv
This should ideally be used more in Geometry Nodes to avoid realizing subdiv
on the cpu if it's not really necessary. However, fully supporting it require more changes
in places that actually need the final subdivided mesh.

This also extends the "to string" conversion for `GeometrySet` to include information
about the subdivision level.
2025-03-27 20:40:58 +01:00
Jacques Lucke
94edc7e77a Geometry Nodes: add utility to ensure that no geometry components are shared 2025-03-27 20:40:58 +01:00