Commit Graph

118845 Commits

Author SHA1 Message Date
Falk David
58fa6a50ce Fix #137152: Grease Pencil: Layer flag is overridden during conversion
Broken by 4c9c9af2d6.

When Grease Pencil objects get converted (<= 4.2 to >= 4.3)
the code copies the legacy color over to the new one.
The issue is that the new color is a `float[3]` not a
`float[4]`! Thus the `flag` after the `color` was getting
overridden.

This fixes the issue by replacing the `copy_v4_v4` with a
`copy_v3_v3`.

Pull Request: https://projects.blender.org/blender/blender/pulls/137161
2025-04-09 13:38:21 +02:00
Habib Gahbiche
f77245e523 Clneaup: Node gizmos: check nullptr before flag access
Pull Request: https://projects.blender.org/blender/blender/pulls/137204
2025-04-09 13:32:56 +02:00
Campbell Barton
82a37e143f Fix #136563: Crash clicking on a light after it has been deleted
Failure to refresh the highlighted gizmo meant that clicking
on a highlighted gizmo would attempt to activate it even though
it's poll function failed - which crashed in this case.

Resolve the common-case by ensuring a call to refresh the gizmo-map
causes the event system to re-evaluate the highlighted gizmo,
even if the cursor doesn't move.

Since it's still possible the call to "refresh" the gizmo is missed,
gizmo_tweak_invoke now checks the gizmo-groups poll succeeds with an
assert and early return if it doesn't. This would have prevented the
crash although the highlighted-gizmo still won't be reset - causing
the cursor to display as if it's over a gizmo until it's moved.
2025-04-09 11:21:55 +00:00
Pratik Borhade
ff85c97278 Fix: Grease Pencil stats in status bar when in edit mode
When in edit mode, wrong stats info is shown for grease pencil. Move the
GP condition above so it is processed before `OB_MODE_EDIT`

Pull Request: https://projects.blender.org/blender/blender/pulls/137194
2025-04-09 11:46:12 +02:00
Jacques Lucke
8674ac339b Cleanup: avoid verbose redundant type names 2025-04-09 11:20:24 +02:00
Campbell Barton
12f0164eb0 CMake: match defines & CMake variable names
Avoid mistakes with these variables getting mixed up
(see: bf03a2684b).

Ref !137183
2025-04-09 08:44:36 +00:00
Jacques Lucke
8f52d535ac Refactor: Geometry Nodes: improve accessing contextual tree log data
The original motivation for this was to prepare the API to support having more
than one tree log for each zone. Currently, there is always a well defined tree
log for each zone (when the inspection index is taken into account). However,
for closures that is less true and there may be more than one equaly valid tree
log. While we might still want to show only one value per socket initially, it
would probably be nice in the future to support accessing information from
multiple evaluations at the same time (also for loops).

None of this is implemented here though, it's just a refactor with no expected
functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/137166
2025-04-09 09:53:48 +02:00
David Murmann
73efe738e4 Fix #135696: Alembic: Interpolate curve control points
Reading curves from alembic files did not interpolate the curves between
frames, leading to incorrect motion blur. This uses the existing
`use_vertex_interpolation` flag on the MeshSequenceCache to enable the
subframe interpolation.

Pull Request: https://projects.blender.org/blender/blender/pulls/135698
2025-04-09 06:50:25 +02:00
Harley Acheson
840f6f2e4c UI: FullScreen Remove Outline and Fix One Pixel Offset
When toggling area "Fullscreen" with Ctrl-Spacebar, there is a one
pixel vertical change in the top of the area. This fixes that,
removes the border and active area outline. Looks much nicer.

Pull Request: https://projects.blender.org/blender/blender/pulls/137184
2025-04-09 04:44:37 +02:00
Campbell Barton
b024fe041e Cleanup: use more descriptive names for the IRIS format
Also add some code-comments.
2025-04-09 01:47:02 +00:00
Campbell Barton
6d8d37558a Cleanup: replace outdated function names in __func__ in error messages 2025-04-09 11:32:21 +10:00
Campbell Barton
7a23d7aba4 Fix: error writing & loading corrupt IRIS files
- Files cannot exceed 65535 width or height,
  attempting to write 65536 would write a zero sized image.
- Ensure that zero sized imbufs are never loaded.
2025-04-09 11:28:58 +10:00
Campbell Barton
35f5877ac3 Fix: incorrect iris image header detection
The first two bytes were being checked in the wrong order,
if files using this header were loaded they would detect as IRIS files
from imb_is_a_iris which would then fail to load (printing errors).
2025-04-09 11:05:47 +10:00
Campbell Barton
e94068e8d2 PyAPI: add "image_webp" build option
Match other image_* format booleans.
2025-04-09 10:26:55 +10:00
Campbell Barton
bf03a2684b Fix: error with CMake checking the wrong WEBP variable 2025-04-09 10:21:37 +10:00
Campbell Barton
2dc4a94e8b Cleanup: use consistent "format_" prefix for imbuf image formats 2025-04-09 00:16:20 +00:00
Campbell Barton
24dd6dd23e Cleanup: quiet warnings with headless builds 2025-04-09 09:55:26 +10:00
Harley Acheson
166d45b80f UI: Padding When Opening Menu When One is Already Open
When you open a menu or popover, moving your mouse to a neighboring
root menu button will switch to that one. For example when you open the
"File" menu and move to the right to have "Edit" open automatically.
This currently causes problems with some neighboring menus. This PR
adds a safety padding to the open item. This generally means that once
you open a menu, you will need to move your mouse into the neighbor's
content, not just hit the edge.

Pull Request: https://projects.blender.org/blender/blender/pulls/135692
2025-04-08 22:45:39 +02:00
Sean Kim
a0eedd2193 Fix: Multiplane Scrape sculpt plane can be incorrect
Similar to !136965

Pull Request: https://projects.blender.org/blender/blender/pulls/137015
2025-04-08 22:36:06 +02:00
Harley Acheson
110b8fee41 UI: Do Not Open Neighboring Menu if Open One is Wide
When a menu is open, moving your mouse to a neighboring menu can cause
that menu to open, closing the open one.  This is very problematic when
the open menu is very wide because users are likely to travel over
other menus while moving toward items in far columns. Typically this is
the "change area" menu, but this can happen with any wide menu. This PR
just checks the menu width and turns off this feature when it is wide.

Pull Request: https://projects.blender.org/blender/blender/pulls/136528
2025-04-08 22:01:40 +02:00
Harley Acheson
b4194b08d4 UI: Do Not Full Hide Scroll Bars When Region Overlap
Currently scroll bars that are in regions that are set to "region
overlap" (like Tool Bar and Side Bar using a transparent background)
will fully hide when your mouse is not near them. This PR removes that
feature so that they are treated like in other areas. This way you can
always see that there are portions of the region scrolled away and what
proportion. A less jarring transition since it is only 0.4 - 1.0,
rather than 0.0 - 1.0.

Pull Request: https://projects.blender.org/blender/blender/pulls/136571
2025-04-08 21:32:43 +02:00
Harley Acheson
b847cc0426 UI: Region Scaling Edge Highlighting
This draws a highlight line on the active edge of regions, like side
bars and toolbars, while dragging to resize them. Similar as we do for
area resizing. This has marginal utility while using a mouse, but is
much more important when using a pen. More so when the pen has a
minimum pressure for clicking. Even more so when using touch as your
finger covers the hit target.

Pull Request: https://projects.blender.org/blender/blender/pulls/136337
2025-04-08 21:12:40 +02:00
Jacques Lucke
93deafd4a3 Refactor: Depsgraph: add const variants of a couple depsgraph query functions
This avoids the need for `const_cast` when using the depsgraph query functions
like `DEG_get_original_id` in many cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/137162
2025-04-08 18:55:22 +02:00
Richard Antalik
bf18e8f814 UI: Filter visible tabs in Properties Editor
This commit allows to specialize or optimize properties editor for
particular workflows by hiding individual tabs. The filtering is done on
editor level, currently in editor options popover panel.

Primary motivation was to allow strip properties to be moved to
properties editor. The filtering is beneficial, as usually it does not
make sense to show strip propeties in modelling workspace and in video
editing workspace other properties would introduce quite a bit of noise.

Ref. #115626

Pull Request: https://projects.blender.org/blender/blender/pulls/115624
2025-04-08 18:43:18 +02:00
Leon Schittek
796e7edfce Nodes: Support snapping when resizing nodes vertically
The snapping was originally only implemented for resizing nodes
horizontally. But since frame nodes can be resized vertically, it
makes sense to also allow snapping in that direction as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/137116
2025-04-08 18:17:01 +02:00
Sean Kim
a4004c3ac4 Fix: Revert some C++ math changes for clay_thumb.cc
* math::normalize doesn't give the same result as normalize_m4
* rotate_direction_around_axis expects a unit vector unlike
  rotate_v3_v3v3fl

Pull Request: https://projects.blender.org/blender/blender/pulls/137159
2025-04-08 18:15:13 +02:00
Leon Schittek
6ba917cd18 Fix: Nodes: Make snapping during resizing more consistent.
Make the snapped size of the node consistent regardless of whether
they are resized by dragging on the left or right edge.

Pull Request: https://projects.blender.org/blender/blender/pulls/137046
2025-04-08 18:03:28 +02:00
Hans Goudey
42adf00f53 Fix #137098: Crash when saving file in edit mode from python load_post handler
Before accessing the BMesh from BMEditMesh, it should be null checked.

Pull Request: https://projects.blender.org/blender/blender/pulls/137155
2025-04-08 18:00:03 +02:00
Jacques Lucke
86341ae826 Fix: ASAN build does not link
When building an ASAN build, I get this link error currently:
```
ld.lld: error: version script assignment of 'global' to symbol '__progname' failed: symbol not defined
ld.lld: error: version script assignment of 'global' to symbol 'environ' failed: symbol not defined
```

The solution (as proposed by Brecht) is to change the symbol names into patterns with a wildcard.
That way the linker does not fail when the symbols are not found.

Pull Request: https://projects.blender.org/blender/blender/pulls/137153
2025-04-08 17:13:59 +02:00
quackarooni
17b5ab6965 Geometry Nodes: Field Statistic Nodes
Adds field versions of the operations from Attribute Statistic, can
support grouping via Group IDs. These operations are added as separate
nodes: `Field Average`, `Field Min & Max`, & `Field Variance` which
group the different statistic operations according to their use.

Supported Data Types:
- Field Average - (Float, Vector)
- Field Min & Max - (Float, Integer, Vector)
- Field Variance - (Float, Vector)

Pull Request: https://projects.blender.org/blender/blender/pulls/134640
2025-04-08 17:12:08 +02:00
Jacques Lucke
8d1b7ce261 Fix: propagate warnings from closure zone to evaluate closure node 2025-04-08 16:50:49 +02:00
Sean Kim
ddd6403f11 Cleanup: Minor Clay Thumb brush plane calculation changes
* Removes unnecessary inverts
* Clarifys brush plane area normal usage
* Reduce scope of variables where possible
* Use equivalent C++ math apis

Pull Request: https://projects.blender.org/blender/blender/pulls/137013
2025-04-08 16:48:52 +02:00
Jacques Lucke
bf5339df14 Fix #137114: crash due to bad mesh ownership handling
When releasing a mesh from a `GeometrySet` one has to take manual control over
owner-management. In some cases, the geometry set was not the owner of the mesh,
but was just referencing it. This is generally fine in a limited set of
circumstances and can avoid copies. However, when taking ownership of the mesh
in the geometry set, one has to be sure that the geometry set actually has
ownership.

This is similar to what is done in e.g. `modifier_modify_mesh_and_geometry_set`.

Pull Request: https://projects.blender.org/blender/blender/pulls/137150
2025-04-08 16:11:52 +02:00
Sergey Sharybin
67fac1e391 Fix #137084: Image Editor shifts the images when Aspect Ratio is not 1.0
Seems to be an incorrect implementation of BLI_rctf_transform_calc_m3_pivot_min()
in 2a44bdfbd0.

Pull Request: https://projects.blender.org/blender/blender/pulls/137141
2025-04-08 15:27:47 +02:00
Falk David
20ce477ea0 Geometry Nodes: Add node to set the Grease Pencil depth order
Adds a new node to set the Grease Pencil depth ordering.

Here are the options:
* 2D Layers: Uses the Layer order + Stroke order to calculate the depth ordering.
* 3D Location: Uses the 3D position of the points as the depth.

This reflects the same setting that is available in the Grease Pencil
object-data properties.

The node is added to the `Grease Pencil` > `Write` menu.

Resolves #129458.

Pull Request: https://projects.blender.org/blender/blender/pulls/135914
2025-04-08 15:24:51 +02:00
Jeroen Bakker
7ecacbc3e6 Vulkan/OpenXR: Support VK_KHR_external_memory_win32
This PR add support to use a win32 handle to perform share render
result with the OpenXR vulkan instance. This is only possible when
the GPU matches. Otherwise a CPU roundtrip will be performed.

Pull Request: https://projects.blender.org/blender/blender/pulls/137093
2025-04-08 15:21:55 +02:00
Brecht Van Lommel
3b203aa71a Fix: ASAN error with Span.slice_safe with empty span
Happened running io_usd_import test.
2025-04-08 14:52:47 +02:00
Jeroen Bakker
22ae59d28d Vulkan: Include Win32 extensions definitions
Includes win32 specific extensions definitions when including
`vk_common.hh`. Inside `gpu_context.cc` vulkan needs to be
included before opengl, otherwise windows 10 builders will
report a warning.

```
[6421/7520] Building CXX object source\blender\gpu\CMakeFiles\bf_gpu.dir\intern\gpu_context.cc.obj
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared\minwindef.h(130): warning C4005: 'APIENTRY': macro redefinition
C:\Users\blender\git\blender-vexp\blender.git\lib\windows_x64\epoxy\include\epoxy/gl.h(59): note: see previous definition of 'APIENTRY'
```

Pull Request: https://projects.blender.org/blender/blender/pulls/137134
2025-04-08 14:10:01 +02:00
Habib Gahbiche
0caa85a6b2 Cleanup: use node.is_type() instead of node.type_legacy
Pull Request: https://projects.blender.org/blender/blender/pulls/137136
2025-04-08 13:14:38 +02:00
Jacques Lucke
3a7dc6ed7f Cleanup: improve comment 2025-04-08 12:29:02 +02:00
Jacques Lucke
2825eee715 Cleanup: include name in printed GeometrySet 2025-04-08 12:29:02 +02:00
Jacques Lucke
53072e7a67 Cleanup: remove unnecessary null check
The null check is not necessary, because the function does not fail
because `PyUnicode_Check` is used on the value already.
2025-04-08 12:29:02 +02:00
Jacques Lucke
82aa6a3b71 Cleanup: improve comment for GeometrySet.name 2025-04-08 12:29:01 +02:00
Jacques Lucke
9c89e9c6fd Fix: raise exception when passing arguments to GeometrySet constructor 2025-04-08 12:29:01 +02:00
Maxime-Cots
a4a4dc7da5 Compositor: Expose interpolation in Corner Pin node
This patch exposes an interpolation option to the Corner Pin node,
allowing to choose between Nearest, Bilinear, Bicubic, and Anisotropic.

Pull Request: https://projects.blender.org/blender/blender/pulls/123206
2025-04-08 12:13:47 +02:00
Philipp Oeser
2a36b613ca Fix #137135: Grease Pencil Join not reporting non-active layer
Reported because this operator relies on an active layer, now report an error if this is
not the case.

Pull Request: https://projects.blender.org/blender/blender/pulls/137138
2025-04-08 12:13:23 +02:00
Sybren A. Stüvel
9605cbde6f Fix #137041: Bugs with Slotted Actions and the Available Keying Set
Make the 'Available' keying set look at the F-Curves for the assigned
slot, instead of the backward-compatible API (which only sees the F-Curves
for the first slot).

Pull Request: https://projects.blender.org/blender/blender/pulls/137131
2025-04-08 11:10:46 +02:00
Sybren A. Stüvel
a753d68271 Anim: remove 'name' spacing from Debug Channel List operator
Remove the space-padding from the channel name in the Debug Channel List
operator.

This is a follow-up commit after !137105, to present things a little
cleaner.
2025-04-08 10:43:58 +02:00
Sybren A. Stüvel
ac87a11ece Anim: expand the debug printing of animation channels with their settings
Expand the "Debug Channel List" operator so that it also shows the channel
settings. The setting name is printed in ALL-CAPS if it is on, and in
lower case letters when it is off.

Note that this operator is only available in debug builds of Blender.

Pull Request: https://projects.blender.org/blender/blender/pulls/137105
2025-04-08 10:41:03 +02:00
Jacques Lucke
d8a959f34a Cleanup: avoid error-prone function cast 2025-04-08 09:54:39 +02:00