Commit graph

159043 commits

Author SHA1 Message Date
Thomas Dinges
ec6e62d40f Release: Bump to 5.1.2 2026-05-18 15:43:39 +02:00
Campbell Barton
e38642afe1 Fix #156286: Error filling extruded text
Correction to [0] which was incomplete,
resolve by tracking which BevList's are reversed.

Rename DL_HOLE to DL_REVERSED since this isn't set from BevList::hole
and only tracks if the data was reversed.

[0]: 8eed0d7c31

Ref !156330
2026-05-16 10:14:16 +02:00
Guillermo Venegas
67906c6e85 Fix: Negative ref-count assert in debug builds using bpy_run_string_exec_with_locals_assume_gil
This hits an negative ref-count assert in msvc debug builds, and can
cause undefined behavior in Linux builds. As mention in
`PyC_DefaultNameSpace`, the returned dictionary object is owned by the
`__main__` module, the reference is just borrowed.

Pull Request: https://projects.blender.org/blender/blender/pulls/156822
2026-05-15 16:11:37 +02:00
Tariq-Sulley
a175579bb7 Fix #156158: Crash entering edit mode after "Make Instance Face" and then duplicating the object
The return type of `active_uv_map_name` is `StringRefNull` and
that of `CustomData_get_active_layer_name` is `const char *` so
the compiler wraps the result of `CustomData_get_active_layer_name`
in a `StringRefNull` constructor for the ternary operator to evaluate to
a single common type but `CustomData_get_active_layer_name`
returns `nullptr` in this case so passing `nullptr` into the
`StringRefNull` constructor triggers a segmentation fault as it
evaluates to `strlen(nullptr)`.
Fix by appending `c_str()` to `active_uv_map_name` to force both
conditions of the ternary to resolve to `const char *`.

Pull Request: https://projects.blender.org/blender/blender/pulls/156198
2026-05-15 16:11:23 +02:00
Campbell Barton
aa3aa0fd21 Fix #156687: Even-odd CDT concave polygons resulting in an empty fill
Resolve CDT even-odd filling error where a polygon without
an edge touching the convex hull wouldn't be filled.

Boundary region detection only checked constrained edges
to the outer face, missing unconstrained hull edges.
This left the search with no starting point, marking all faces as holes.

Unconstrained hull edges are now also used to detect boundary regions,
but constrained edges are prioritized since they carry the actual
polygon crossing winding.

Ref !156688
2026-05-15 16:10:50 +02:00
Campbell Barton
8454f7795b Fix #155733: Incorrect font filling when curve extrude is enabled
When a 2D curve is extruded, geometry is built from bevel list data
where hole contours have their winding reversed (for correct surface
normals). The CDT fill then inherited this reversed winding, causing
the non-zero fill rule to behave like even-odd.

Resolve by flagging reversed outlines and correcting them
when filling the arrays for CDT input.

Ref !155742
2026-05-15 16:10:14 +02:00
YimingWu
3a8a03cae6 Fix #156431: LineArt: Correct collection flags inheritance
Previously line art collection flags and intersection priority will only
work if you set it on object's immediate parent. Not sure how long the
issue persisted, likely after line art object instance rewrite. The most
likely reason that this was not really discovered because most cases we
do set object's intersection flags/priority or set it at their immediate
parents. This PR makes sure that values in parent collections gets
inherited to child objects.

One thing this PR did additionally is it will always assign a intersection
line to one of the object it came from. This will indeed create
ambiguity as in which object did the intersection line come from,
however it's much better because we can at least filter them by
collection, which is much more usable in real life productions.

Pull Request: https://projects.blender.org/blender/blender/pulls/156433
2026-05-15 16:06:25 +02:00
YimingWu
064c5791fd LineArt: Make intersection lines follow face mark filtering
Previously line art doesn't take face mark into consideration when
generating interestion lines, so faces that are inhibited from
generating lines will still produce intersection lines, this can lead
to visual artifacts in structures like mouth corner creases. This fix
will prevent filtered faces from generating intersection lines.

Pull Request: https://projects.blender.org/blender/blender/pulls/156580
2026-05-15 16:06:14 +02:00
Habib Gahbiche
ab633462d3 Fix #156753: glTF: fix lamp color/intensity export
Color is now using lamp.color x emission node color
Except for EEVEE where node setup is ignored

For intensity: For EEVEE, node setup is ignored

The exported values are now aligned with what the viewport displays.
Before 5.1, nodes data was used, and lamp properties was used if no nodes data was present.
But in 5.1, a node tree is created by default event if not used by EEVEE. It leads to misunderstanding by users why color/intensity was not exported.

Pull Request: #157130

Co-authored-by: Julien Duroure <julien.duroure@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/158627
2026-05-15 16:02:11 +02:00
Christoph Neuhauser
76c4dfd8d1 Fix #157777: Vulkan: Backport texture pool workaround for Intel Windows
The following two commits are backported to blender-v5.1-release:
- 0bedd81f2b
- bf20994350

The former disabled the texture pool only for Intel 7th to 10th Gen
Processor iGPUs, while the latter disabled it for a wider range of
GPUs. Some refactoring happened on main where
`workarounds.no_texture_pool` was renamed to
`GCaps.texture_pool_workaround`, but I kept the old naming in the
backport.
Disabling the texture pool works around visual corruptions and
memory leaks on older Intel iGPUs with certain driver versions.

Pull Request: https://projects.blender.org/blender/blender/pulls/158641
2026-05-15 15:55:07 +02:00
Christoph Neuhauser
f635ba83d8 Fix #157777: Vulkan: Use texture pool workaround on Intel Windows
The usage of the texture pool after the visual corruptions fix for
the image cache workaround for #156496 leads to memory leaks.
This commit enables the texture pool workaround for Intel Windows
until the issues have been resolved.

Pull Request: https://projects.blender.org/blender/blender/pulls/157994
2026-05-15 10:36:27 +02:00
Martijn Versteegh
6226674d83 Fix #156765: Prevent crashes whan an empty attribute is read as single value
The attribute data can be null when the size is zero, but to create
single values there needs to be data. In this case just ignore the
single value status, it doesn't really make a difference for empty
attributes anyway.

Pull Request: https://projects.blender.org/blender/blender/pulls/156779
2026-05-15 09:50:01 +02:00
Martin Loga
956fd000a2 Fix crash in BLI_mmap.cc on WIN32
Address an issue running blender 5.x on the otoy rndr network
where it crashes when loading a scene.

Reset the file pointer to the beginning of the file
in case we are closing it using the windows file
handle due to failure of reading it with memory map.

This keeps everything consistent for later opening that file again.

Ref !155823
2026-05-15 08:03:16 +02:00
Thomas Dinges
96bbff21af Release: Bump to 5.1.2 release candidate 2026-05-15 08:02:13 +02:00
Thomas Dinges
b70da489d7 Release: Bump to 5.1.1 2026-04-13 16:35:06 +02:00
Tariq-Sulley
0bd956b86b Fix #156068: Skin modifier creates disconnected geometry
The fix in 3c3cde26b5 treated any frame
vertex shared with the target hull face as a degenerate case and fell
back to creating a simple cap face instead of attempting to fix the
detached frame with `skin_fix_hole_no_good_verts`. This could cause the
output of the skin modifier to be disconnected in some cases.
Fix by gating the shared vertex cap on the absence of interior frame
vertices.

Pull Request: https://projects.blender.org/blender/blender/pulls/156214
2026-04-13 08:28:21 +02:00
Sybren A. Stüvel
35a2ca4c10 Fix #155953: Geometry nodes bake paths not reported via foreach_path
This was never implemented. Adding support is relatively simple.
We either expose the path corresponding to the bake or the
path the bake will inherit from the modifier.

Because there are arbitrarily many metadata files and the connection
to the binary blob files is only clear at runtime when loading the bakes,
this PR just exposes the entire directory.

Co-authored-by: Sybren A. Stüvel <sybren@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/156380

Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/157175
2026-04-10 12:42:11 +02:00
Sybren A. Stüvel
6a713d7797 Fix: correct path for foreach_path callback of object's particle systems
Correctly process objects' particle systems in `object_foreach_path()`.
The `//blendcache_particle` directory is now reported.

Previously the code reported the `cache->path` property, for each
cache in the particle system. However, that path is only to be used
when the 'External' checkbox is checked.

Pull Request: https://projects.blender.org/blender/blender/pulls/155720
2026-04-10 11:51:44 +02:00
Campbell Barton
0a9ee3dc25 Fix #155822: Out of bounds buffer read when writing AVIF image format
Saving AVIF was reading past the buffer bounds for 8bit images,
workaround the bug by re-allocating a buffer with the necessary
padding to avoid the error.

This has been fixed up-stream, the workaround can eventually be removed
when we drop support for older OIIO versions.

Ref !155824

5.1 backport.

Pull Request: https://projects.blender.org/blender/blender/pulls/157119
2026-04-10 09:43:39 +02:00
Brecht Van Lommel
9c285aa0da Fix #155861: Crash rendering CMYK JPEG textures in Cycles
The OpenImageIO version we use has broken CMYK to RGB conversion in
JPEG, this is a temporary workaround until we upgrade to a newer
version. Directly read the CMYK image with libjpeg.

Note that when we upgrade, we can remove the CMYK conversion code
entirely as OpenImageIO supports this natively nowadays.

---

NOTE: This is the backport for 5.1.1.
Pull Request: https://projects.blender.org/blender/blender/pulls/157146
2026-04-10 09:07:36 +02:00
Campbell Barton
a99a198d38 Fix #155878: Point light gizmo doesn't stick to cursor anymore
Fix #155878: Point light gizmo doesn't stick to cursor anymore

    Resolve regression in [0] check caused the point light radius
    not to follow the cursor.

    [0]: b4b2e05858

    Ref !156194

Fix: glitch scaling orthographic camera gizmo with shift X/Y

    Grabbing the edge of the camera with the shift set to ~2 would behave
    as if the opposite edge was grabbed and the cursor moved from one
    side of the camera to the other.

    There is no need to use the pivot in this calculation as the deltas
    already take the pivot into account.

Pull Request: https://projects.blender.org/blender/blender/pulls/157124
2026-04-09 15:25:54 +02:00
Campbell Barton
e622d316e2 Fix #155928: Undo argument can no longer be passed to the operator
Resolve regression in [0] which didn't account for a single positional
boolean argument.

[0]: 877283a09a

Ref !155997

Pull Request: https://projects.blender.org/blender/blender/pulls/157122
2026-04-09 15:23:02 +02:00
Campbell Barton
2edae0c5e0 Tests: add tests for sub-classing & calling operators from Python
Add two tests, one to check that sub-classing works as expected,
another for the operators callable types.

Written to validate fixes for #155928 & #155996 and ensure
there are no further regressions.

Ref !155994
2026-04-09 15:23:02 +02:00
Campbell Barton
c1878785d6 Fix #155996: Crash calling operators with non-string keywords
Resolve regression in [0] which didn't account for the move to our
own callable type needing to validate the key types in the keyword dict.

Add `PyC_Dict_CheckKeysAreStrings` utility to allow reuse for
callable types in the future.

[0]: 877283a09a

Ref !155997
2026-04-09 15:23:02 +02:00
Hans Goudey
9d4793865d Fix #155830: Invalid freestyle attributes on CustomData
Backport of 0e6342e77c

Pull Request: https://projects.blender.org/blender/blender/pulls/157125
2026-04-09 15:20:18 +02:00
Sebastian Parborg
560dba73e1 Fix: cattrs was not listed as a dependecy for the bpy module 2026-04-09 15:02:08 +02:00
Christoph Lendenfeld
d7a9364fec Fix #156995: Pose library applies to bones hidden by collection
Caused by a09d0cfd8c

The above commit added a new function
`BKE_pose_channel_find_selected_names`.
Compared to its counterpart `BKE_armature_find_selected_bone_names` it
didn't check for collection visibility when determining which bones
should count as selected. Since that function is used when applying
pose assets, it would now also apply to bones hidden by a collection.

The fix is to use `animrig::bone_is_selected` which does check collection visibility.

Pull Request: https://projects.blender.org/blender/blender/pulls/157039
2026-04-09 13:16:26 +02:00
Julien Duroure
eadb07693b Fix #156415: glTF UVMaps export
Starting Blender 5.1, applying modifier do not return an active UVMap

So, glTF exporter needs to check if there are some UVMaps by checking size of uv_layers, instead of existance of layer.active

Pull Request: https://projects.blender.org/blender/blender/pulls/157068
2026-04-09 12:43:45 +02:00
Brecht Van Lommel
8d1c985b13 Fix #155797: Crash with fast undo and color wheel clicks
Don't set some node pointers to null after freeing, so that even on read
after free in the UI code, this mostly does not crash. This is reverting
part of 9fde9d68bf.

A proper fix for this is in #155797, but is was considered too risky to
backport. This may help on some systems but also not improve things on
others.

Pull Request: https://projects.blender.org/blender/blender/pulls/156712
2026-04-09 12:41:59 +02:00
Guillermo Venegas
565a288afb Fix #156022: Menu auto scroll can stop at submenus buttons (Backport)
This includes 2 different commits from main, see individual commits for details.

Backport: Fix #156022: Menu auto scroll can stop at submenus buttons

When a button overlaps the auto scroll handler it not longer gets
completely hidden, instead the button is partially drawn, that makes
buttons to be interactive.

This prevents to open sub-menus or to highlight other buttons while
hovering auto scroll-handlers.

Fix Regression: Auto open menus not working after using menu auto scroll handlers

Mistake in 58aa355049

When using an auto-scroll handler for popups a timer is created to
handle the auto-scroll, however currently this timer is created just
once and when the mouse moves inside the popup or when the scroll hits
its minimum/maximum value the timer still remains active.

This removes the timer when the auto-scroll handler is not hovered
or it can't scroll anymore.

Also note that Pie menus are using the scrolltimer for popup animations,
so also allow auto-opening menu buttons on pie menus.

Pull Request: https://projects.blender.org/blender/blender/pulls/156049
2026-04-09 12:37:21 +02:00
Omar Emara
a4b6ac33f0 Fix: Memory leak in cached image code
Cached image code leaks an intermediate result that wraps external data.
This is a consequence of 2735711420, since external data previously did
not require freeing. To fix this, just add a release call after use.

Pull Request: https://projects.blender.org/blender/blender/pulls/156756
2026-04-09 09:47:21 +02:00
Omar Emara
77f4daa93e Fix #156334: Denoise node causes crashes
The Denoise node crashes Blender if denoising passes were connected
directly to a Denoise node inside and outside a node group at the same
time. That's due to double free where the derived data of the pass is
freed twice. This happens because denoising passes referenced external
data, and the result class assumed that external data would not have a
data reference count, and while that is true for the actual data, it is
not true for derived data, so data sharing might lead to derived data
getting freed twice.

To fix this, we keep track of data reference count even for external
data.

Pull Request: https://projects.blender.org/blender/blender/pulls/156368
2026-04-09 09:46:58 +02:00
Jonas Holzman
bac15f14bd Fix #155844: Nondeterministic 3D Viewport Trackpad orbiting direction on Windows
The issue was caused by a failing `RegGetValueW()` call in
`getScrollDirectionFromReg()` within GHOST TrackpadWin32 due to
uninitialized output arguments, causing nondeterministic orbiting
direction depending on the environment.

Fixed by properly initializing the`scrollDirectionRegValue` and
`pcbData` variables passed to the function. In addition to this, a
correction was made to the default value returned in the querying
failing case, and comments were added to better detail the meaning of
return values.

Pull Request: https://projects.blender.org/blender/blender/pulls/156986
2026-04-09 09:46:48 +02:00
Patrick Mours
6a5af874ba Fix #155371: Materials render black with EEVEE
With NVIDIA driver 595+ some materials would render black in EEVEE
with the Vulkan backend. This turns out to be because of an issue in
the eevee_surf_deferred/hybrid_frag.glsl shader: `gbuffer::pack_closure`
is doing a switch on the closure type that was fetched from
`g_closure_bins`. However, control flow before that does not guarantee
that `g_closure_bins` was initialized at that point (it can be by the
the shader node evaluation, but there are code paths where it is not).
The compiler thus determines that the closure type may be unitialized,
which is undefined behavior and therefore it is free to optimize the
entire switch and connected code away.
This fixes that by ensuring the closure type is always initialized.

Pull Request: https://projects.blender.org/blender/blender/pulls/155847
2026-04-09 09:45:07 +02:00
Mark van de Ruit
6e7aed26d9 Fix #156496: Add Intel workaround for VKImageCache
Disables use of `VKImageCache` in `VKTexturePool` to workaround certain
driver issues on Windows Meteor/Arrow/Alder Lake and older Intel cards.

Pull Request: https://projects.blender.org/blender/blender/pulls/156689
2026-04-08 14:38:31 +02:00
Nathan Vegdahl
c423a0a7ca Fix: Crash when opening certain files with library overrides
There was a missing nullptr check in the library override code, which
resulted in segfault crashes when loading some files that have library
overrides.

Pull Request: https://projects.blender.org/blender/blender/pulls/156746
2026-04-08 14:36:45 +02:00
Jeroen Bakker
d910d3dc33 Fix #155467: Artifacts Wayland + NVIDIA 595
There is an obsolete swapchain configuration being checked.
This configuration was used 2 years ago when wayland color management
wasn’t mature. Nowadays this configuration is not being used until
the latest NVIDIA driver started to use it again. This made some bugs
appear as incorrect code paths is being selected to copy framebuffer
to the swapchain.

Pull Request: https://projects.blender.org/blender/blender/pulls/156741
2026-04-08 14:36:04 +02:00
Christoph Neuhauser
56c1868807 Fix: Vulkan: Disable vertex input dynamic state on legacy Intel iGPUs
Using VK_EXT_vertex_input_dynamic_state on Intel 7th to 10th Gen
Processor iGPUs leads to a black screen at application startup.
The usage of the extension on legacy Intel drivers is disabled to avoid
this issue. The issue was originally reported at
https://projects.blender.org/blender/blender/issues/147721 as a
follow-up of an OpenGL issue with these old iGPUs.

Pull Request: https://projects.blender.org/blender/blender/pulls/156577
2026-04-08 14:34:46 +02:00
Brady Johnston
635a1d3ed2 Fix #155983: Bump numpy minimum version forbpy release
Along with the VFX reference platform `numpy` version was increased everywhere to `2.3` but the script for building & packaging `bpy` for release as a package was missed.

This currently aligns with `install_linux_packages.py` which sets `2.2` as the min numpy version to have some leniency, but can be increased to hard 2.3 minimum if needed. bc4c6f6de1/build_files/build_environment/install_linux_packages.py (L592)

Fixes: #155983

Pull Request: https://projects.blender.org/blender/blender/pulls/155984
2026-04-08 14:33:16 +02:00
Pratik Borhade
27f6b144ba Fix #155581: Quick Favorites: some items are not removable from the menu
`ED_screen_user_menu_item_find_operator` fails to return operator due to
`IDP_EqualsProperties/ok_idprop` being false. Buttons defined with
`template_id_def_new_but` doesn't allocate idpropgroup, so apparently
`but->opptr->data` is null. But when added in quick favorites menu,
`layout->op/uiItemFullO_ptr_ex` creates idpropgroup
"wmOperatorProperties". This mismatch case eventually fails to show
"Remove" button in quick favorites. To fix this, pass `is_strict=false`,
that way `IDP_EqualsProperties_ex` returns true when either of idprop
in comparison is null.

Pull Request: https://projects.blender.org/blender/blender/pulls/155609
2026-04-08 14:32:55 +02:00
John Kiril Swenson
ada6f2bd41 Fix #156015: VSE: Make new duration property writeable
Having it read-only was an intentional choice at the time due to
discussion in #153012.  Changing strip duration and the right handle
position effectively did the same thing from the UI.

But there are some cases where we might want to change duration instead.
Such as when "copying to selected" or if performing logic from a script.
So make the new property writeable too.

Pull Request: https://projects.blender.org/blender/blender/pulls/156115
2026-04-08 14:32:06 +02:00
YimingWu
3730d5530c Fix #155748: Use factor instead of distance for texture_sample_bias
This value is a factor related to the current texture value, not a
distance value with a unit.

Pull Request: https://projects.blender.org/blender/blender/pulls/155750
2026-04-08 14:28:37 +02:00
Ay1nDas
b8149e2ee5 Fix #152505: VSE: Sync scene time doesn't work with hard split scene strips
Hard split information (`anim_startofs/endofs`) was ignored by "Sync
Scene Time."

To fix, update `sync_active_scene_and_time_with_scene_strip` and
`ANIM_draw_scene_strip_range` to take this into consideration.

Co-authored-by: John Kiril Swenson <eliphaz@noreply.localhost>
Pull Request: https://projects.blender.org/blender/blender/pulls/155450
2026-04-08 14:27:42 +02:00
Thomas Dinges
09b8c49cf2 Cleanup: make format 2026-04-08 10:09:50 +02:00
Thomas Dinges
3b2e5b4bfb Fix compile error due to missing refactor.
Rather then backporting https://projects.blender.org/blender/blender/pulls/156169 change the line to use the old name.
2026-04-08 10:06:43 +02:00
Pullusb
08f823dcd8 Grease Pencil: Expose strokes fill_id and hide_stroke attributes to high level python API
Expose grease pencil `fill_id` and `hide_stroke` attributes to high
level python API. This allows to easily get or set those attributes
using the stroke object itself in scripts or interactive console.

#### Usage:
For the example, let's store a drawing (first frame on first layer of
an active GP object):
`drawing = bpy.context.object.data.layers[0].frames[0].drawing`

Using low level API:
`drawing.attributes['fill_id'].data[0].value = 1`
`drawing.attributes['hide_stroke'].data[0].value = True`

Now also possible directly on stroke object with high level API:
`drawing.strokes[0].fill_id = 1`
`drawing.strokes[0].hide_stroke = True`

Pull Request: https://projects.blender.org/blender/blender/pulls/156246
2026-04-08 09:33:40 +02:00
Omar Emara
2719ae9b79 Fix #156830: GPU Compositor crashes for huge resolutions
The GPU compositor crashes if the render resolution is too large. This
is because the compositor is internally limited to 8k resolution due to
hardware limitations. To fix this, we error out before the render
starts, this is the same fix as b81cca4033 but on the UI level.

Pull Request: https://projects.blender.org/blender/blender/pulls/156927
2026-04-08 09:33:18 +02:00
Martijn Versteegh
a141d7f040 Fix #156801: Don't remap edge vertices of edges that are not part of a face
Screw modifier sorts edges that are part of a face and keeps a map of
the sorting. It also tried to remap edges where the first vertex
happened to touch the face, but as the second vertex wasn't part of the
face it was not in the map. Skip edges not in the map.

Pull Request: https://projects.blender.org/blender/blender/pulls/156811
2026-04-08 09:32:44 +02:00
Lukas Tönne
a05e9b4833 Fix #156381: Axes-to-Rotation node needs a fallback function
The node_build_multi_function callback must always result in a valid
multifunction for the node. Use a constant value in case the rotation
axes are the same and no real function is defined.

Pull Request: https://projects.blender.org/blender/blender/pulls/156429
2026-04-08 09:32:35 +02:00
YimingWu
9e81951383 Fix #156643: Animrig: Don't insert frames for keying sets without path
Previosly when user added a path to a keying set but not filled in the
actual path, attemting to insert a keyframe in this keying set will
crash due to empty string and a failed RNA property parsing. Now guard
this situation early to avoid this kind of problem.

Pull Request: https://projects.blender.org/blender/blender/pulls/156733
2026-04-08 09:32:24 +02:00