Commit Graph

120532 Commits

Author SHA1 Message Date
Sean Kim
0354d2e02c Cleanup: Fix warnings
Introduced in b472570875
2025-06-27 14:00:51 -07:00
Sean Kim
b472570875 Fix #140998: Grease Pencil stroke-level color jitter doesn't work
Introduced with 96e549c092

While the above commit applied versionings to the related flags, it did
not convert either the UI elements or the underlying grease pencil code
to use the now generic `Brush` properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/141001
2025-06-27 22:21:53 +02:00
Hans Goudey
7fe9e87263 Fix: AttributeStorage skips reading attributes from empty domains
This check was meant to catch unknown failure cases but instead it
meant any attribute with an empty array (e.g. from a mesh with no
faces) would not be loaded. Instead the failure case should only be
when there is no data when the array is not meant to be empty.

Pull Request: https://projects.blender.org/blender/blender/pulls/141096
2025-06-27 17:22:01 +02:00
Clément Foucault
3b9525ce7d Fix #141067: EEVEE: Mising UDIM texture Crash the EEVEE
It was missing the error texture for the tile maps.

Pull Request: https://projects.blender.org/blender/blender/pulls/141072
2025-06-27 15:46:37 +02:00
Campbell Barton
db2f8782b5 Fix #141018: Gizmos allow editing linked data
Camera, lamp & object placement gizmos weren't checking ID data was
editable.

Ref !141069
2025-06-27 13:25:31 +00:00
Andrej730
6dc0c85de6 Fix: PyDocs: GPUShader, use ref for better navigation
Also note removal version.

Ref !140846
2025-06-27 18:52:53 +10:00
Patryk-Skowronski
5f28ef5574 NDOF: Removed impact of the auto orbit center on Fly Mode
Remove the impact of Auto orbit center preference onto Fly mode.
Until now, it was possible to experience dynamic translation speed
changes in the Fly mode with Auto preference enabled for the orbit
center. This was not desired.

Ref !141035
2025-06-27 08:02:34 +00:00
Howard Trickey
a20f367379 Fix #141026: Degenerate Dissolve crashes Blender.
The code added in commit ffc204d1fa to dissolve redundant 2-edged
vertices after a manifold boolean assumed that after dissolving such
vertices a valid face would remain. This is not true of the face
started out degenerate (all vertices on the same line).
Fixed by checking for such cases and in any case not creating
any faces with less than three vertices.
2025-06-26 13:59:20 -04:00
Sergey Sharybin
5ae21e5518 Fix: Dead-lock in VSE audio waveform preview
The VSE preview job was pushing tasks while holding a lock
which is also used by the task. This could lead to a dead-lock
situation if scheduling decides to run the task immediately.

The easiest way to reproduce the issue is to run Blender with
`-t 1` command line argument and add WAV file.

The solution is to iterate over queue and create tasks while
holding a lock, but push them to the pool after releasing the
lock.

Pull Request: https://projects.blender.org/blender/blender/pulls/140972
2025-06-26 17:31:46 +02:00
Hans Goudey
165c344e98 Fix: Assert in barbershop file calculating GPU subdiv orco buffer
For some reason the orco vertex buffer is requested after the position
buffer, but they are computed together. In case that happens, just
discard the position buffer.

Pull Request: https://projects.blender.org/blender/blender/pulls/141043
2025-06-26 17:17:17 +02:00
YimingWu
516e12c0df Fix: Manifold boolean assert copying vertex group names twice
They will be copied in subsequent `BKE_mesh_copy_parameters_for_eval`,
copying the list again will cause an assert.

Pull Request: https://projects.blender.org/blender/blender/pulls/141031
2025-06-26 17:03:19 +02:00
Clément Foucault
1073abe62f Fix #140152: EEVEE: Crash while playing animation
This happened because the velocity module is referencing
batche to be able to copy them after drawing.

Make sure to call step swap even when shaders are not
ready to ensure we don't dereference these possibly
freed batches on the next draw.

This also fixes the crashing benchmarks.

Pull Request: https://projects.blender.org/blender/blender/pulls/141022
2025-06-26 16:52:50 +02:00
Clément Foucault
ea2284af11 Fix #140762: Overlay: Curve doesn't display Bevel Preview in Edit Mode
This was caused by the retopology visibility check being faulty.

See https://projects.blender.org/blender/blender/issues/140762#issuecomment-1612468
for more detail.

Pull Request: https://projects.blender.org/blender/blender/pulls/141037
2025-06-26 16:40:26 +02:00
Clément Foucault
6fee44760a Fix: Overlay: Missing refresh when toggling retopology overlay
This appear as meshes still present or missing when toggling
the option.

This was caused by the change in update detection from the
overlay properties.
2025-06-26 15:39:10 +02:00
Hans Goudey
8ebb759046 Fix: Realize Instances use-after-free with collections
The calls to `to_geometry_set` in this file can create a temporary
Instances struct for collections. That instances component will contain
two attributes, which are currently referenced in the attributes map
even after the temporary compoment storage goes out of scope. A simple
fix is to avoid adding these attributes to the map in the first place.

An alternative that would also be more efficient would be to handle each
instance reference type explicitly, without converting it to a temporary
geometry set. That seems to significantly complicate the code though;
for now it doesn't seem worth it.

Pull Request: https://projects.blender.org/blender/blender/pulls/140999
2025-06-26 15:07:34 +02:00
Campbell Barton
0417719ae9 Help text: move Vulkan debugging option under "Debug Options" 2025-06-26 21:57:49 +10:00
Campbell Barton
0f590bbfb6 Cleanup: correct flag name for NDOF Y/Z axis swap 2025-06-26 21:50:03 +10:00
Campbell Barton
c3d5e429ac Fix crash assigning non UTF8 path to imbuf.filepath 2025-06-26 19:10:54 +10:00
Sybren A. Stüvel
2ce3e8c877 Fix #140969: Joining armature objects that share their data fails assertion
Add a precondition check that verifies all to-be-joined armatures are
unique. If this is detected, an error is shown and the operator is
aborted.

Joining shared Armatures is non-trivial, because the corresponding
pose bones may actually have different drivers or constraints on them
(because those live on the Object ID, and not the Armature).
Duplicating any shared Armature ID could be a first step, but I am not
convinced this is always the right approach. This is why joining
shared Armatures is not supported for now. Users can choose how to
make each Armature unique, either by deselecting objects or by
duplicating their data.

Pull Request: https://projects.blender.org/blender/blender/pulls/140971
2025-06-26 11:01:41 +02:00
Pratik Borhade
7e17ec5562 Fix #140747: Ignore armature from custom shape list
When armature is selected for custom shape of a bone, we run into
stack overflow due to recursive calls. To prevent this situation,
exclude armature object type from the custom shape list.

This also clears the `pchan->custom` pointer after loading/linking a
blend file. Otherwise a linked Armature object can still be assigned
indirectly, by renaming objects in the library file.

Fixes: #140747
Fixes: #140959

Co-authored-by: Sybren A. Stüvel <sybren@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/140851
2025-06-26 10:48:06 +02:00
Campbell Barton
2355a32017 Fix crash calling bpy.data.file_path_map with non UTF8 paths 2025-06-26 18:35:37 +10:00
Campbell Barton
521fae81fc Cleanup: remove redundant call to BLI_path_basename 2025-06-26 18:12:41 +10:00
Campbell Barton
6d06fc3979 Fix immediate exit when displaying an invalid UTF8 title on Wayland
A non UTF8 title on Wayland causes disconnection from the server.
Resolve by using the path as-is unless invalid UTF8 byte sequences
are found, in that case they're replaced by `?`.

This is skipped on WIN32 & macOS since the issue only exists on Wayland.
2025-06-26 18:01:06 +10:00
Campbell Barton
c5bae85893 BLI_string: add BLI_str_utf8_invalid_substitute
Similar to BLI_str_utf8_invalid_strip except that it substitutes
invalid characters and doesn't change the string length.

Useful for displaying strings that include invalid UTF8 code-points.
2025-06-26 18:01:06 +10:00
Jeroen Bakker
40eaaf089f Vulkan: Switch Qualcomm to switch to OpenGL
Due to driver issues qualcomm devices that try to start Blender with
a driver below 31.0.112.0 will automatically switch to OpenGL.

Pull Request: https://projects.blender.org/blender/blender/pulls/140902
2025-06-26 08:49:37 +02:00
Campbell Barton
8536261164 Fix crash calling the transform operator over the redo panel
Calling transform over the redo panel would access the regiondata
as a RegionView3D for any region type.

Resolve by checking the region type - as done elsewhere transform code.
2025-06-26 05:00:31 +00:00
Campbell Barton
582a54b94c NDOF: apply YZ axis swap to rotations
Apply the "Zoom direction" preference to the rotation axis.
Until now, this preference was limited to translations.

Note that the X/Y swap is now applied in the accessor functions instead
of wmNDOFMotionData::tvec because swapping the X/Y axis doesn't work
well in some cases (color picker for example), and it's confusing
of axis swapping is handled in different parts of the code for
rotation & translation.

Ref !140975

Co-authored-by: Patryk-Skowronski <patryk_skowronski@3dconnexion.com>
2025-06-26 03:23:25 +00:00
Howard Trickey
ffc204d1fa Fix #140574: Manifold boolean leaves redundant 2-edged vertices.
This is discussed more in PR #140773.
The cause of the breakage was the change of the Manifold library
version from 3.0.1 to 3.1.0. That change is very positive otherwise
because we can remove the "use runids" workaround to prevent bad
face merging, and that removal is also part of this commit.
Removing that changes the time to do a big sphere-sphere test
from 660ms to 340ms.
The problem that needed fixing is that the new library version appears
not to do some aggressive simplification that the old version did,
and as a result, when we dissolve triangulation edges after the boolean
is done, it sometimes leaves valence-2 vertices on original edges.
To fix that, new code detects and then dissolves such vertices.
2025-06-25 13:44:49 -04:00
Campbell Barton
5b06823f99 Fix #140929: Crash attempting to link from the current file from Python
Add an error check that the path being linked doesn't match the current
blend file.

Also resolve reference leak in the case of library override errors.
2025-06-25 13:37:52 +00: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
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
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
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
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
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
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
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
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
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
Campbell Barton
7e2926233d Fix #138742: Knife tool not locking to axis when snapping to edge
Regression in [0] which moved the logic from
knife_closest_constrain_to_edge from 2D to 3D space.
The 3D location used (kcd->curr.cage) didn't have constraints
applied, causing snap not to lock to the constrained axis.

Resolve by passing in the constrained location which is then used when
edge snapping is calculated.

[0]: 7249b78b6b
2025-06-24 15:24:49 +10:00
Hans Goudey
2e568d31ed Fix #140767: Render Simplify "Normals" option doesn't work
One obvious problem is that `mr.use_simplify_normals` was assigned after
face corner normals were retrieved. The other more complex problem is
that now the normals caches automatically mix custom normals from other
domains. This can cause the expensive "Tangent Space" normals to be
calculated even though we don't explicitly request face corner normals.
To fix this, clarify the purpose of the option to only apply to that custom
normals format and use the true normals instead in that case.

Pull Request: https://projects.blender.org/blender/blender/pulls/140879
2025-06-24 03:52:40 +02:00
Rob Blair
379fffaf0d Fix #139664: bevel weight is now used for offset collisions #140436.
Problem - offset collision check for bevels did not consider the reduced
offset when using bevel edge weights, thus greatly reducing the allowed offset.
Solution - calculate the offset check using the weighted value and not
the full offset.
Alternatives - Since this error was introduced in the patch dd334faa58
a solution would be to revert the patch. This is not optimum since the
patch did correct the inf/inf condition in the offset calculation (ex at
90 degs, tan is 1/0).
Limitations - This patch is a correction to return the bevel function to
it's previous abilities. Further work is needed to properly handle edge
offset interference when looking at n-gons with reflex angles. There are
also situations where the bevel operation exceeds the checked offset distance
(exs. inner arc spread and bevel profiles that are not normal to the bevelled edge).
2025-06-23 21:15:48 -04:00
Sean Kim
7274fdb377 Fix #140556: Mask filter operations behave incorrectly on dense meshes
Mistake in 57c4e9dd2c

Pull Request: https://projects.blender.org/blender/blender/pulls/140570
2025-06-23 19:22:33 +02:00
Sean Kim
41d8066b1e Fix: Potential NaN when calculating average values
It is possible for a vertex to be processed by some function that
attempts to calculate the average of an attribute of all neighboring
elements when all elements are hidden. This results in NaN when using
`math::rcp` for the size of the related indices.

This commit switches the `rcp` call for the safe variant and removes an
invalid assert that previously existed.

Further cleanup to consolidate the various different average methods
will occur in the main branch (e.g. the `check_loose` and `interior`
functions)

Pull Request: https://projects.blender.org/blender/blender/pulls/140569
2025-06-23 19:21:53 +02:00
Sean Kim
ffcbe6205b BLI: Add assert for indexed_data_equal
Typically, we use this function to determine whether or not a subset of
data that has been collected with `gather` needs to be then persisted
into a larger array with `scatter`. As such, it makes sense to assert on
equality of the indices and smaller array size.

Pull Request: https://projects.blender.org/blender/blender/pulls/140752
2025-06-23 17:57:59 +02:00
Philipp Oeser
5790ff3b6a Fix #140801: Particle Weight Overlay Broken
Was not showing weights on the lines (but the points instead).
Points were supposed to show selection though, not weights.

This is now corrected.

Pull Request: https://projects.blender.org/blender/blender/pulls/140862
2025-06-23 17:52:31 +02:00
Brecht Van Lommel
a7bcea76d7 Fix #139769: ACES 2.0 configuration fails with shader errors
This code was initially only for OpenColorIO 2.3, and then later removed in
the refactor. But it appears to still be needed for 2.4 and configs like this.

Pull Request: https://projects.blender.org/blender/blender/pulls/140824
2025-06-23 15:13:59 +02:00
Julian Eisel
e852533ddd Fix #140781: Crash on "Adjust Pose asset" from Asset Browser
See:
https://projects.blender.org/blender/blender/issues/140781#issuecomment-1608861.
2025-06-23 14:39:41 +02:00
Sergey Sharybin
7519586ec0 Fix #140693: Crash on enabling override in file output color settings
The code around view transform selection accidentally got too coupled
to the scene. However, the file output settings do not have scene, so
the enumerator getter was crashing.

Caused by 7ceb4495c5.

This patch brings the code closer to the Blender 4.4 behavior by
maintaining a global from view name to an ID.

There is still a bug in the code which displays views from the active
scene's display settings in the override panel. This is because the
itemf() callback is hardcoded to use the display settings from the
active scene (via bContext). However, this issue exists since the
initial commit of the color management override option.

Pull Request: https://projects.blender.org/blender/blender/pulls/140729
2025-06-23 14:02:59 +02:00
Richard Antalik
6b8970d728 Fix: VSE: Using redo panel causes operator to fail
When movie strip is added and redo panel is tweaked, operator failed to
re-execute.

Caused by c4eab49b9. This added `sequencer_generic_invoke_xy__internal`
call in operator exec function, but did not specify `SEQPROP_NOPATHS`
argument, which caused `directory` and `filepath` properties to be
overwritten.

This PR adds clarification for `SEQPROP_NOPATHS` use case, because it
isn't immediately obvious what this is doing.

Pull Request: https://projects.blender.org/blender/blender/pulls/140736
2025-06-23 01:01:01 +02:00