Commit Graph

120993 Commits

Author SHA1 Message Date
Jacques Lucke
72110757b6 Fix: Geometry Nodes: links removed after syncing bundle/closure nodes
This makes sure that sockets keep their old identifiers so that links remain intact.

Pull Request: https://projects.blender.org/blender/blender/pulls/140956
2025-06-25 09:55:00 +02:00
Omar Emara
27e716a165 Fix: Crash when using coordinates in the compositor
The compositor crashes when using any image coordinates in GPU mode.
That's because the realization operation didn't support Float2 images so
far. To fix this, we handle Float2 images for realization.
2025-06-25 09:43:05 +03:00
Campbell Barton
8787366cca Merge branch 'blender-v4.5-release' 2025-06-25 16:34:34 +10:00
Jacques Lucke
f3d58ebb5b Fix: Geometry Nodes: crash with missing linked data-block
Geometry nodes can't be evaluated when the node tree is not available. This
never worked before and the modifier evaluation was "cancelled" later on before
already. However, new code in the modifier evaluation requires the modifier to
be cancelled earlier already which is what this patch does.

Pull Request: https://projects.blender.org/blender/blender/pulls/140923
2025-06-25 08:30:39 +02:00
Campbell Barton
def8b04492 Merge branch 'blender-v4.5-release' 2025-06-25 16:09:44 +10:00
Campbell Barton
3d852e4071 Fix #140439: Crash using "Edit Source" in popovers
Using "Edit Source" from a buttons context menu in a popover could
access freed memory when comparing buttons. Resolve by checking the
button still exists in the region.
2025-06-25 06:07:28 +00:00
Richard Antalik
ee0f7ad521 Merge branch 'blender-v4.5-release' 2025-06-25 07:16:38 +02:00
Richard Antalik
62e25e315a Fix #140740: Blender fails to output video
Caused by change in `AVCodecID` enum. Our `IMB_Ffmpeg_Codec_ID` enum,
which was stored in .blend file did match `AVCodecID`. But after change
in external library headers it fails to initialize correct codec.

Function `MOV_av_codec_id_get()` was added to map these 2 enums and
the values are no longer hard coded.

Functions, that accepted `int codec_id` argument were modified to accept
`IMB_Ffmpeg_Codec_ID` or `AVCodecID` types.

Because `codec_id` was still stored as integer in DNA, get/set struct functions
were added. This way, compiler always knows what type is used and emit
error/warning when incompatible types are used.

Unfortunately, there is no way to ensure, that DNA `codec_id` field is not
accessed directly in future code other than comment.

Pull Request: https://projects.blender.org/blender/blender/pulls/140745
2025-06-25 07:15:13 +02:00
Omar Emara
00d375755f Compositor: Avoid redundant executions for only previews
The compositor executes redundantly if previews are enabled but no
other output is computed. This shouldn't be the case because previews
are secondary outputs that need a primary output to compute with.

We improve this this by only executing the compositor if a primary
output is needed, regardless if previews are needed or not.

Pull Request: https://projects.blender.org/blender/blender/pulls/140920
2025-06-25 07:06:18 +02:00
Campbell Barton
5d553e1dd0 Merge branch 'blender-v4.5-release' 2025-06-25 04:42:53 +00:00
Campbell Barton
2a757f469c Fix cursor size being ignored by custom cursors under Wayland
The theme cursor size was ignored when setting custom cursors
such as the knife, only the DPI from GHOST was taken into account.

This meant cursors such as the knife would sometimes display too small.

Now when the theme-size is larger, a larger cursor will be used.

Currently the theme size is read from XCURSOR_SIZE environment variable
however it may be read from the system preferences in the future.

Also fix the software cursor sizes which incorrectly used the UI scale
preference which is ignored by cursor sizes.
2025-06-25 04:39:57 +00:00
Hans Goudey
a12f7717a1 Refactor: Attributes: Add assign_data function
Prevent an extra copy that could happen when calling
data_for_write() to retrieve mutable access, only to just
replace the data.

Pull Request: https://projects.blender.org/blender/blender/pulls/140946
2025-06-25 05:08:20 +02:00
Hans Goudey
25e0957f8e Cleanup: Attributes: Resolve reference binding to null warning
The sharing info might be null if the array is null / empty.
2025-06-25 05:08:18 +02:00
Hans Goudey
eadb259aee Fix: Attributes: Data potentially lost in versioning
For files saved with the new format, the versioning can incorrectly
replace the AttributeStorage data with whatever is inside of CustomData,
even if that's nothing. So far this is only in one unlikely case for
point clouds, but these functions will soon be used for Grease Pencil
and curves.
2025-06-25 05:08:18 +02:00
Hans Goudey
4e7ee26cb3 Cleanup: Attributes: Implement get_builtin_default for PointCloud
This is currently only used for curves, but it may be used elsewhere
in the future, so it's best to make sure it's implemented consistently.
2025-06-25 05:08:18 +02:00
Hans Goudey
b915da45d8 Cleanup: Attributes: AttributeOwner utility to retrieve storage
This helps share the implementation of many functions between
geometry types (in the future, now only point clouds at runtime).
2025-06-25 05:08:18 +02:00
Hans Goudey
94c2a7e0b5 Cleanup: Attributes: Add AttributeOwner function for accessor
This is a better way to make the existing static function available
outside of `attribute.cc`.
2025-06-25 05:08:18 +02:00
Hans Goudey
1c32de3095 Cleanup: Remove meaningless const for return by value 2025-06-25 05:08:18 +02:00
Hans Goudey
4b4314483d Cleanup: Attributes: Properly use unitialized memory for copy
Add a "ForUninitialized" utility function and use copy construction
correctly. This doesn't make a difference yet because we only
have trivially constructible attribute types so far.
2025-06-25 05:08:18 +02:00
Ramon Klauck
53578d33ae VSE: Keyframing in Preview
This PR makes it easier to add keyframes for strips in preview.
This works same way as in 3D viewport, using keying sets. Pressing I
key adds keyframe to default keying set, pressing K dhows menu with
available keying sets. For VSE, location, rotation and scale properties
are available for now. Other existing keying sets are not valid for
VSE.

Deleting keyframes and potentially adding more keying sets will be
handled in separate PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/140107
2025-06-25 02:56:55 +02:00
Sean Kim
27433106cd Cleanup: Use C++ types and functions for multires_reshape_apply_base
Also converts a manually managed temporary array with `blender::Array`

Pull Request: https://projects.blender.org/blender/blender/pulls/140784
2025-06-25 01:06:48 +02:00
Sean Kim
9d3c038a27 Cleanup: Use C++ math types and functions for displacement Evaluator
Pull Request: https://projects.blender.org/blender/blender/pulls/140789
2025-06-25 01:05:06 +02:00
Sean Kim
64e237d074 Cleanup: Use C++ math types and functions for multires_reshape_smooth.cc
This doesn't yet touch lines that use the `ReshapeGridElement` or
`ReshapeConstGridElement` structs, those require further cleanup
elsewhere before making such changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/140782
2025-06-24 23:56:10 +02:00
Sean Kim
1a7ebffeca Cleanup: Use C++ math types and functions for multires_reshape_util.cc
This commit does not change lines that access the `ReshapeGridElement` or
`ReshapeConstGridElement`, that cleanup will follow in a later commit.

Pull Request: https://projects.blender.org/blender/blender/pulls/140783
2025-06-24 23:50:55 +02:00
Clément Foucault
6535c999e0 Cleanup: Overlay: Avoid motion path issuing warn about missing uniforms 2025-06-24 22:09:09 +02:00
Clément Foucault
92b93d6d77 Fix #120969: Overlay: Assert when drawing motion paths
Avoid out of bound reads.
2025-06-24 22:09:02 +02:00
Hans Goudey
8c71719dfd Refactor: UI: Use std::string for uiLayout heading string
Changes the size of uiLayout from 408 to 184 bytes.
2025-06-24 15:09:21 -04:00
Guillermo Venegas
2e5138fed8 Refactor: UI: Replace uiItemPointerR with uiLayout::prop_search
This converts the public uiItemPointerR and uiItemPointerR_prop
functions to an object-oriented API (uiLayout::prop_search overloads),
matching the python API.

Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/140930
2025-06-24 20:47:54 +02:00
Sean Kim
74fbeeeccb Merge branch 'blender-v4.5-release' 2025-06-24 10:28:14 -07:00
Miguel Pozo
7150d0fd1c Refactor: Draw: Use ResourceHandleRange in engine code
Prepare for #140378 by replacing all uses of `ResourceHandle` inside
the engine code with `ResourceHandleRange`.

Aside from the replacement, this changes `ResourceHandleRange` itself
to ensure we use them correctly:
- Prevent direct access to the first handle, to avoid not taking ranges
into account by mistake.
- Add missing functions that are safe to use for ranges
(`has_inverted_handedness` and `is_valid`).
- Add functions that aren't safe to use for ranges, but are required
for the code paths that don't support them yet (these functions assert
that the range points to a single handle, and therefore can be used
safely).

The main change is in `draw_handle.hh`, everything else is just a 1:1
port to use these new functions.

Pull Request: https://projects.blender.org/blender/blender/pulls/140611
2025-06-24 18:15:44 +02:00
Clément Foucault
8e0b920c39 Fix #82238: Drawing size of particles not matching DPI
Remove dependency on UI scaling.
2025-06-24 18:11:54 +02:00
Habib Gahbiche
8e966cceaa Compositor: Support rotation for split node
The split is now defined by a line that can have an arbitrary angle.

This PR implements the node only, the gizmo is implemented in #140356

Pull Request: https://projects.blender.org/blender/blender/pulls/140208
2025-06-24 17:18:15 +02:00
Dhiraputta Pathama Tengara
a2cc3370ed Fix: Constrain screenshot selection to window edges
Improves the screenshot selection UX by ensuring the selection
rectangle stays within the window.

**Changes**

- Clamp the selection rectangle while dragging the cursor,
preventing it from extending outside the window.

- When shifting the selection area, movement is constrained
so that the entire rectangle remains within the window.

- When `force_square` is `true`, the square is clamped to the
largest possible square that fits within the window bounds
if it would otherwise exceed them.

Pull Request: https://projects.blender.org/blender/blender/pulls/139805
2025-06-24 16:06:27 +02:00
Piotr Makal
515533b342 Fix #140813: Bevel operation crashes when representative face is null.
Fix #140813 crash, when bevel operation doesn't choose proper representative
face (called frep, facerep or rep_face in code). In such scenario a nullptr
would be assigned to uv_face->attached_frep field in register_uv_face function
and later, as a result of that, BM_face_vert_share_loop function would crash
during call to update_uv_vert_map function.

This commit also includes additional safety check in register_uv_face function,
as well as removes compiler warning about assigned but unused center_bme variable.

This is from PR https://projects.blender.org/blender/blender/pulls/140864
but applied to the 4.5 release branch.
2025-06-24 09:08:30 -04:00
Piotr Makal
c329907435 Fix #140813: Bevel operation crashes when representative face is null.
Fix #140813 crash, when bevel operation doesn't choose proper representative
face (called frep, facerep or rep_face in code). In such scenario a nullptr
would be assigned to uv_face->attached_frep field in register_uv_face function
and later, as a result of that, BM_face_vert_share_loop function would crash
during call to update_uv_vert_map function.

This commit also includes additional safety check in register_uv_face function,
as well as removes compiler warning about assigned but unused center_bme variable.

This is from PR https://projects.blender.org/blender/blender/pulls/140864
but applied to the 4.5 release branch.
2025-06-24 08:33:01 -04:00
Hans Goudey
98a1456129 Workbench: Avoid CustomData lookup when unnecessary
CustomData lookup is very expensive compared to everything else
happening in this function. Use a slightly ugly approach to avoid it
when the display type isn't "Attribute" or "Texture". This gives a 5%
FPS playback improvement in the Erindale Flower shop demo file.

Pull Request: https://projects.blender.org/blender/blender/pulls/140547
2025-06-24 13:42:38 +02:00
Omar Emara
383c8860a2 Compositor: Remove Texture node
This patch removes the Texture node from the compositor, which was based
on the legacy Internal Textures system in Blender. The main motivation
for removing this node is as follows:

- Procedural texturing nodes that previously existed in shading and
  geometry nodes are now supported in the compositor, which cover 95% of
  what is previously possible using and even adds new possibilities like
  Gabor, Bricks, and various improvements to existing texture types.
- The old texture system did not support GPU evaluation, so it was
  always computed and cached on the CPU, which causes bad performance
  especially for interactive use in the viewport compositor. While the
  new nodes are fully GPU accelerated and do not require any caching.
- The Texture node didn't support Texture nodes, so it was not fully
  supported and we so far had a warning about that.
- The general direction in Blender is to remove the old texture system,
  and the compositor was one of the last main users of it. 5.0 is thus
  the ideal time to remove such use.
- The Texture node was always and still is a source of bugs, since it
  relies on proper tagging for cache invalidation and updates, which is
  so far not perfect. It also suffers from UI/UX issues, since it needs
  to be adjusted from the properties panel, which can break if there are
  other texture nodes in the context.

This is a breaking change and no versioning was attempted since:

1. It is impossible to get the same results as before due to the use of
different random number generators, so any versioning would just give us
the general look.
2. The Texture node supports a lot of possible configurations. For
instance, each general texture can have many options for the basis type,
and each basis type might have multiple options. So versioning all of
that will take a lot of time, code, and effort.

Pull Request: https://projects.blender.org/blender/blender/pulls/140545
2025-06-24 11:54:39 +02:00
Jeroen Bakker
e63a20fee1 Vulkan: HDR support for Wayland
This change enables HDR support for wayland as an experimental feature.
It supports both non-linear extended sRGB and un-clamped sRGB.

Windows isn't supported as the HDR settings are not accessible via an
API and would require similar settings that games use to configure the
monitor. Adding those sliders isn't what we would like to add.

Vulkan (working group) is working on new extensions that might change
the shortcomings. It isn't clear yet what the extension will do and what
the impact is for applications that want to use it. When the extension
is out we should review at the situation again.

Pull Request: https://projects.blender.org/blender/blender/pulls/133159
2025-06-24 11:51:14 +02:00
Bastien Montagne
301d421234 Fix missing brushes in UI after IDProps split commit.
Yesterday's 7276b2009a commit splitting idprops between 'user' and
'system' defined ones fully broke brushes in the UI.

The issue is, Asset metadata stores additional info in its idprops,
without exposing them to user, but without creating RNA access for them
either.

For now, revert their RNA definition to be 'user-defined' ones, enabling
their access through 'dict-like' syntax in Python.

On the longer run, we probably want a cleaner solution for them. While
the issue is similar to the 'Node Modifier' (and 'Node Tool') cases, not
sure if we would actually want to define RNA access for these asset
metadata, as they are likely more like a 'raw data' container, without
requirement for setters, getters, updates etc. that are provided by
actual RNA properties?

So maybe we rather need to define a proper way to access this type of
storage (raw idprops, but strictly managed by Blender, and not the
user)? Could be by exposing them as an explicit property, with probably
a new sub-type of `PropertyGroup`?

CC @JulianEisel & @dr.sybren
2025-06-24 10:49:04 +02:00
Campbell Barton
a88ff71148 Merge branch 'blender-v4.5-release' 2025-06-24 17:58:50 +10:00
Campbell Barton
56898fafcf Merge branch 'blender-v4.5-release' 2025-06-24 17:58:45 +10:00
Campbell Barton
cda9ce9777 Fix #136396: Metaball Cube can't be selected with solid shading
The metaball selection radius was inside the cube and could only
be selected with wire-frame shading.

Resolve by expanding the radius by the dimensions of the cube.
2025-06-24 07:56:50 +00:00
Jacques Lucke
cd952a1a70 Cleanup: Nodes: improve eager closure evaluation comment 2025-06-24 09:54:55 +02:00
Christoph Lendenfeld
32d2bc0a59 Fix #139277: box selecting on the summary line fails with NLA in tweak mode
The issue was that the summary channel was marked as
possible to do NLA mapping in `ANIM_nla_mapping_allowed`.
When it comes to doing the actual mapping it would silently do nothing
though because `bAnimListElem.adt` is always a `nullptr` for the summary.
However in `action_select.cc:580` the `KED_F1_NLA_UNMAP`
and `KED_F2_NLA_UNMAP` flags were already removed.
Those flags tell the summary line to do NLA mapping in `keyframes_edit.cc:368`.
(We may be able to remove those in the future)

The fix is to ensure that the summary line is
recognized as unable to do NLA mapping. That makes sense to
me at least because the summary line points to data but in itself
does not know about the NLA.

As a side effect, this also fixes circle select.

Pull Request: https://projects.blender.org/blender/blender/pulls/140664
2025-06-24 09:53:06 +02:00
Omar Emara
4f32795ed5 Fix: Compositor assert on wrong result type
Since image coordinates now uses Float2 types, implicit input operations
should use the same type, which was missed in a recent refactor.
2025-06-24 10:26:16 +03:00
Clément Foucault
066cdf1d94 Fix #140894: EEVEE: ASAN error loading the 2D Animation workspace
ASAN report errors for a value of -1 (all bits high) but
dones't for a value of 0. In this case it doesn't matter which
of the two values are used since they are both invalid and
will be updated inside `assign_if_different`.
2025-06-24 09:24:10 +02:00
Jacques Lucke
5bfe1692f9 Merge branch 'blender-v4.5-release' 2025-06-24 09:03:30 +02:00
Jacques Lucke
f3ba5bf08d Fix #140876: input socket interface not correctly propagated by link-drag-search
The solution is to use the same utility function that's also used when
connecting links to the extend socket of the Group Input node.
2025-06-24 09:02:18 +02:00
Campbell Barton
cebcb9c682 Merge branch 'blender-v4.5-release' 2025-06-24 15:57:08 +10:00
Campbell Barton
0be817a01c Fix knife tool showing axis in the wrong direction before cursor motion
Changing constraints required cursor motion to refresh the display.
2025-06-24 15:53:47 +10:00