Commit Graph

120665 Commits

Author SHA1 Message Date
Campbell Barton
841b3e9d81 Fix: avoid divide by zero in the "Stretch To" constraint
A zero scaled axis resulted in the matrix containing NAN values.
Use `safe_divide` to avoid this.

Ref !141654
2025-07-10 21:05:52 +10:00
Aras Pranckevicius
f6e2afb82a Fix #141715: VSE video proxies lose video rotation
ffmpeg_copy_display_matrix needs to be done after avcodec_parameters_from_context
call, since that one (re)initializes all the parameters.

Pull Request: https://projects.blender.org/blender/blender/pulls/141716
2025-07-10 11:42:24 +02:00
Sergey Sharybin
413d8e5406 Fix #141651: VSE: The Channel setting does not work independently in multiple areas
Make display channel part of the key for the final cache.

The prefetch uses display channel of 0, which is the default. It might
need to be adjusted, but it is unclear whether it was behaving different
prior to the 9e4c26574a.

Pull Request: https://projects.blender.org/blender/blender/pulls/141670
2025-07-10 11:35:39 +02:00
YimingWu
69da277dcb Fix #141693: Grease Pencil: Restore jitter behaviour
The line to get `jitter_settings_` was accidentally removed by
cac2806ee2. This patch adds that back so
strokes will still have the correct jitter settings when drawing.

Pull Request: https://projects.blender.org/blender/blender/pulls/141707
2025-07-10 11:03:07 +02:00
Campbell Barton
9f666b3ca8 Fix #139982: Subdivide curves doesn't interpolate curve tilt
Correct bezier curve interpolation & support tilt for bezier & nurbs
curves.
2025-07-10 18:07:51 +10:00
Aras Pranckevicius
077bd15387 Fix #141652: python exception when adding VSE Fade
Keep invalidate_cache('COMPOSITE') working, and map that to invalidation
of final frame & intra-frame caches of the strip.

Pull Request: https://projects.blender.org/blender/blender/pulls/141714
2025-07-10 09:51:53 +02:00
Campbell Barton
68f559db5d Fix #141663: Wrong help-line displayed when rotating the camera
When transforming a camera show a helper line from the frame center.
2025-07-10 05:29:47 +00:00
Campbell Barton
4a68512db9 Fix #141612: Boolean crash with NAN mesh vertex coordinates
Resolve crash caused from initializing `mpq3` values with NAN.

Ref !141655
2025-07-10 10:47:15 +10:00
Miguel Pozo
88f812bf9a Fix #141253: Bring back the global Draw lock
Alternative solution to #141392 / #141564.

As a recap, the DST global lock (which prevented running drawing code
from multiple threads concurrently) was removed for 4.5 (#134690).
One unforeseen issue is that Images (and their GPUTextures) are shared
across dependency graphs (and therefore multiple threads), meaning we
are running into data race issues with them.

@fclem did #141392 and I continued it #141564. However, this is only a
partial solution, parts of the GPUTexture API and the whole BKE_image
API are still unsafe.
Trying to solve all the possible underlying issues seems unrealistic for
4.5 given the time frame and that the extension of the code affected by
this issue is quite large.

So this PR just brings the 4.4 locking behavior instead, which, while
risky on its own, seems much safer to me than the alternative.

This effectively undoes the improvements from #134690 by disabling
concurrent rendering, but instead of reverting all the code, it just
ensures we hold the lock in the same places we did in 4.4.
This means there's some redundant code that is not technically needed
anymore, like the `submission_mutex`, but it's probably best to make as
few modifications as possible, given how close we are to release and
that this is only intended as a temporary measure.

Pull Request: https://projects.blender.org/blender/blender/pulls/141618
2025-07-09 15:11:29 +02:00
Thomas Dinges
82f75f22ef Release: Bump 4.5 to release candidate 2025-07-09 12:56:08 +02:00
Omar Emara
23d06e9c9a Fix #141568: Implicit convert for single values return zeros
Implicit conversion for single values always return zero in GPU device.
That's because the conversion data was only stored on the CPU and not
uploaded to the GPU, so we ensure it gets uploaded to GPU.

Pull Request: https://projects.blender.org/blender/blender/pulls/141658
2025-07-09 10:43:03 +02:00
Jeroen Bakker
2170739ba3 Fix #141628: Vulkan: Crash when index buffer could not be allocated
Added an early exit when the index buffer could not be allocated. Most
likely when there is an out of memory issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/141653
2025-07-09 08:57:57 +02:00
Campbell Barton
0d944c16c6 Fix: assertion filling curve caps with a zero normal vector
Don't attempt to fill curve caps when the direction vector is invalid.

This prevents the crash in #141612 however the root cause of that
report isn't directly related to curve filling.
2025-07-09 15:44:22 +10:00
Campbell Barton
3d6e9756c7 Fix #141400: Metaball tessellation unresponsive with a scaled parent
The check to prevent overly complex tessellation checked the objects
scale directly instead of the final evaluated scale.

Also corrects the scale check which wasn't accounting for negative axes.
2025-07-09 15:23:42 +10:00
Jesse Yurkovich
a8f543f6a8 Fix: USD: Add MeshSequenceCache modifier for animated crease values
The mesh importer was only checking for animated positions, velocities,
and primvars when determining if a cache modifier needed to be used.
Extend this to crease values (and normals) too.

The added test ensures a base level of coverage here.

Related to: #141633

Pull Request: https://projects.blender.org/blender/blender/pulls/141643
2025-07-09 04:44:30 +02:00
Jonas Holzman
82dc3f25a7 Fix #137750: Low timeline height when restoring area layout using different DPI
This commit fixes a bug where the timeline area height was clamped to
its minimum value when restoring an area layout saved on a non-HiDPI
screen on a HiDPI screen. In particular, this caused the default Blender
startup file timeline area to be wrongly clamped dwon on macOS when
using a HiDPI/Retina screen.

This was due to the `screen_geom_vertices_scale_pass` function using raw
`area->winy` value in the `facy > 1` case, which ensures the timeline
does not get expanded when resizing the window if its already at its
minimum height. When restoring the area layout, these `winy` values
were not yet refreshed, and still used the DPI scale of the screen
the layout was saved on. Which in case of macOS HiDPI screens caused
them to be two times smaller then the screen / other size values used
in the function.

This was fixed by using the `screen_geom_area_height()` instead, which
computes the area height from its screen geometry coordinates, and was
previously used in this function before being replaced by `winy`. The
comparaison now also uses a fixed value instead of `facy` which was
also subject to DPI differencies, see PR thread for more details

Pull Request: https://projects.blender.org/blender/blender/pulls/141154
2025-07-08 21:55:52 +02:00
Brecht Van Lommel
bfacc42651 Fix: EEVEE/Workbench crash rendering without an active object
Regression from 62568d16e5, this was crashing most of the EEVEE
and Workbench render tests.

Pull Request: https://projects.blender.org/blender/blender/pulls/141624
2025-07-08 18:38:41 +02:00
YimingWu
7c8b8b2457 Fix #141475: LineArt: Prevent image editor drawing when baking strokes
Line art bakes strokes in a separate thread, which will also update
depsgraph, and if an image editor is present, it will try to iterate all
the objects in the view layer and this is unsafe. Now line art will set
region drawing lock to prevent image editor from drawing while baking.

Pull Request: https://projects.blender.org/blender/blender/pulls/141551
2025-07-08 18:11:59 +02:00
Sybren A. Stüvel
fc32c26722 Fix #141323: Copy to Selected doesn't properly update on some Bone props
Fix an issue with Copy to Selected on bones, where an RNA pointer was
given an owner of the wrong type.

A pointer was constructed to a `Bone` (which is owned by the
Armature), but the owner was taken from the corresponding `PoseBone`
(which is owned by the Object), causing Armature "property update"
callbacks to be called without an actual Armature. This caused the
wrong data to be tagged for re-evaluation, which caused the issue.

Also f04bc75f8c affected the Copy to Selected on edit bones.

Co-authored by Philipp Oeser

Pull Request: https://projects.blender.org/blender/blender/pulls/141394
2025-07-08 17:10:54 +02:00
Hans Goudey
4eefd4d6dc Fix: Potential assert in curves AttributeStorage versioning
The runtime type map needs to be updated even if the CustomData
ends up being empty.
2025-07-08 10:04:01 -04:00
Sean Kim
62568d16e5 Fix #140621: Multi-object edit mode displays non-active UVs as faded
The feature to display multiple objects in the UV and Image Editor was
added in 24d08e0bae.

This commit did not account the multi-edit mode feature, where there may
be more than one object currently being edited, causing some UVs to
display with a faded opacity.

To fix this, introduce a new `eObjectInfoFlag` flag to indicate this
state, populate it when syncing the object, and use the flag inside the
relevant shaders.

Pull Request: https://projects.blender.org/blender/blender/pulls/141254
2025-07-08 15:51:09 +02:00
Casey Bianco-Davis
46a6641c4d Fix: Grease Pencil: Bezier handle types not updating when transforming
When handles are selected but not the control point this will convert the types `auto` to `align` and `vector` to `free`

This adds `tag_topology_changed` to make sure the handle types are updated.

This also fixes a problem where `free` handle would not be transformed with the control point.

Implement following Curve objects #128638

Pull Request: https://projects.blender.org/blender/blender/pulls/141438
2025-07-08 15:47:38 +02:00
Jeroen Bakker
20bad6e29a Fix #141477: Crash during material selection
Material selection didn't support empty geometries. Geometry list can
have nullptrs, when meshes contain more than 16 materials, but some
materials slots are not actually used in the mesh.

Material selection used to still looped over all the materials and
tried to draw geometry that aren't there.

Regression from !139781

Pull Request: https://projects.blender.org/blender/blender/pulls/141608
2025-07-08 15:42:59 +02:00
Marc Hamamji
2aa7502d3b Fix #139533: Select vertices and faces after bevel operation
When beveling a vertex with only 2 connected edges, the resulting
geometry was not selected.

Resolve by not only selecting the faces created by the bevel operation,
but also selecting the vertices created.

Note: apply the same change as before,
the LFS data has been manually pushed.

Ref !139691
2025-07-08 22:57:41 +10:00
Alaska
6cd82784a5 Fix #141519: EEVEE automatic light threshold doesn't work with exposure
Pull Request: https://projects.blender.org/blender/blender/pulls/141526
2025-07-08 14:55:14 +02:00
Campbell Barton
cbb32d104a Revert "Fix #139533: Select vertices and faces after bevel operation"
This reverts commit 3f6262f115.

There is a problem with the blend file not being on the server,
Reverting until the issue can be resovled.
2025-07-08 22:19:58 +10:00
Jeroen Bakker
402cf10760 Fix #141476: Vulkan: Disable descriptor buffer on Windows/Intel
Windows/Intel GPU crashes when descriptor buffer cannot be allocated
anymore. This PR enables a workaround by not using descriptor buffers.

In future we should investigate how to improve the GC of descriptor
buffers and review the limits.

Pull Request: https://projects.blender.org/blender/blender/pulls/141600
2025-07-08 14:02:51 +02:00
Andrej730
8246ea913f Fix: wrong argument name in doc-string
Correct regression from !141334.

Ref !141592
2025-07-08 12:00:32 +00:00
Habib Gahbiche
3eb4a59a13 Fix: Viewer nodes inside node groups not updating properly
Switching back and forth between viewers with shortcuts doesn't trigger
the compositor to update as expected when inside a node group.
See PR description for an example file.

The issue was caused by a missing tree update.

Pull Request: https://projects.blender.org/blender/blender/pulls/141606
2025-07-08 13:52:53 +02:00
Marc Hamamji
3f6262f115 Fix #139533: Select vertices and faces after bevel operation
When beveling a vertex with only 2 connected edges, the resulting
geometry was not selected.

Resolve by not only selecting the faces created by the bevel operation,
but also selecting the vertices created.

Ref !139691
2025-07-08 21:42:11 +10:00
Jason C. Wenger
065313eabe Fix edge dissolve behavior with face-split
Correct problem where face split inadvertently triggered the
un-triangulate detection logic in places due to freshly added diagonals.

Defer face split until after tagging is complete so the new edges don't
interfere with edge counting.

Ref !141511
2025-07-08 10:33:25 +00:00
Falk David
a1893bf5e1 Fix #139194: Grease Pencil: Crazyspace deformation broken when evaluated layers don't match original
When the layer tree in the evaluated state of the Grease Pencil object changed,
the code would fail to get the crazyspace deformation.

Currently we rely on a 1 to 1 index mapping of the original and evaluated
layers. For obvious reasons, this is very weak and can easily break.

The new implementation works as follows:
* Caller that wants to get the crazyspace deformation passes the evaluated and original
   object + the original drawing to get the deformation of.
* Fallback deformation are the original positions.
* If there are drawing edit hints in the evaluated geoemtry set, then
  * find the edit hint that corresponds to the original drawing
  * use the positions in the edit hint.

To create the drawing edit hints, we need to know what evaluated layer corresponds
to which original layer. Currently, this simply stores the original layer index on the
evaluated layer runtime data.

The solution is not ideal and there are some possible improvements like:
* Find a way to solve the more general case, e.g. when there are multiple original
  IDs involved.
* Propagate the "mapping" to original layers even when the type of geometry is
  changed, like going to curve instances and back.

Pull Request: https://projects.blender.org/blender/blender/pulls/139285
2025-07-08 12:11:42 +02:00
Omar Emara
1dbeeacc80 Fix: Kuwahara Size can be negative
The Kuwahara node allows negative size which this should not be the
case.
2025-07-08 12:45:28 +03:00
Habib Gahbiche
75333e0ea5 Fix: Compositor: Potential crash if no active context is found
This is related to #140381, where the symptom of the bug was a crash
caused by an undefined behavior. In that case, setting a valid active
viewer key was the proper fix. However,
`find_active_context_recursive()` could return `nullptr` in theory so
the same problem might occur in the future.

The commit resolves the undefined behavior by avoiding the
dereferencing of a null pointer.

Pull Request: https://projects.blender.org/blender/blender/pulls/141270
2025-07-08 11:34:11 +02:00
Omar Emara
1c98f29ed3 Fix: Wrong GL data format for RG integer textures
The GPU_RG16I format was assigned a wrong GL data format, which is
probably a typo.

Pull Request: https://projects.blender.org/blender/blender/pulls/141409
2025-07-08 07:57:33 +02:00
Campbell Barton
20ee5c2283 Fix buffer overflow reading the selection buffer
Reading from the top-right of the selection buffer could read
past the buffer bounds. Resolve by ensuring the clamped buffer
isn't empty. Relates to #141591.
2025-07-08 15:38:18 +10:00
Michael B Johnson
a5f915d3d3 Fix: USD: Correct the exported extents for point instancers
Adds and corrects the extent attributes of USD PointInstancer prims.
Extents are now computed for PointInstancers just before the USD stage
is saved and during the export finalization step. The unit test has been
updated accordingly.

This PR also marks all point instancers' prototypes as over after the
extent calculation is done, including the prototypes used by nested
point instancers. This follows the official USD recommendation to place
prototypes under a point instancer marked as over:
https://openusd.org/docs/api/class_usd_geom_point_instancer.html#:~:text=place%20them%20under%20a%20prim%20that%20is%20just%20an%20%22over%22

Authored by Apple: Zili Zhou (Liz)

Co-authored-by: Zili (Liz) Zhou <zili_zhou@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/141299
2025-07-08 06:19:32 +02:00
Campbell Barton
4431d7a369 Fix #141514: Broken cryptomatte picking with multi-windows on Wayland
Only perform window under cursor checks for GHOST back-ends that
have the window positioning capability.
2025-07-08 10:36:10 +10:00
Campbell Barton
01f064d7c6 BLF: suppress assertions when displaying non UTF8 text
Showing non UTF8 paths in the file browser asserted.
2025-07-08 10:12:19 +10:00
Harley Acheson
cfc42f7f54 Fix #141501 - Allow Transparency for marker/Scrubbing Region
When Timeline and similar regions become very short we try to remove
overlapping parts as they can no longer fit. While doing this I didn't
consider that the marker/Scrubbing Region color could include
transparency. This PR just backtracks a little and hides the marker
region in a different way, allowing transparency if wanted.

Pull Request: https://projects.blender.org/blender/blender/pulls/141581
2025-07-08 01:58:56 +02:00
Hans Goudey
0ce5738415 Fix #141262: Undo speed regression (4.5)
The memfile undo data-block change detection didn't work for meshes
because we ended up writing a new pointer every time. In practice the
array the pointer references is always empty anyway, so we can just add
a check and write null instead.

Unfortunately this fix only applies to 4.5, since the attribute DNA
data (which is actually used at runtime in 5.0) is created temporarily
specifically for writing, so it gets a new address every time.
We'll probably need to solve #127706 in 5.0 to fix this.

Pull Request: https://projects.blender.org/blender/blender/pulls/141457
2025-07-07 22:06:59 +02:00
John Kiril Swenson
a7f6d80395 Fix: VSE: Zooming all the way in scrolls to the right
Zooming in `view_zoomstep_apply_ex` ignores any kind of v2d limits,
which are only applied later in `UI_view2d_curRect_validate`. After
zooming in all the way, further attempted zooms get undone by
`ui_view2d_curRect_validate_resize` in the following manner:
1. VSE has no `V2D_LIMITZOOM` flag set, so a v2d that is too small tries
   to grow to `v2d->min[0]`.
2. Since `V2D_KEEPOFS_X` flag is set so that resizing the VSE can be
   anchored to the left, the way that the v2d is altered to grow to the
   minimum width (10 frames) is by increasing only `cur->xmax` instead
   of both sides.

Fix by gating keepofs logic behind a similar `do_keepofs` to the one
which was added to `view_zoomstep_apply_ex` in 385a8a4d6a.

This is quite safe and regression-proof since every space but the
VSE has `V2D_ZOOM_IGNORE_KEEPOFS` unset, in which case the logic is
unchanged.

Ref: 7d9499bdc4, 8b36cf3eac, 385a8a4d6a, 28b1a33e16.
2025-07-07 17:56:05 +02:00
Germano Cavalcante
cd143ca900 Fix: Wrong depth status in gizmo selection
When selecting gizmos (such as one of the scale handles in the
Transform tool), the depth test state does not match what is shown in
the viewport. This can lead to unintuitive gizmo selection.

The issue is caused by the incorrect assumption that the depth state is
already `GPU_DEPTH_NONE` before rendering the gizmos for selection.

The solution is to ensure the status before rendering.

Pull Request: https://projects.blender.org/blender/blender/pulls/141412
2025-07-07 16:54:22 +02:00
Sybren A. Stüvel
d4961dac0b Fix #141341: Assert using proportional editing in object mode
Remove `BLI_assert(tc->sorted_index_map);` calls. Add one special case
in the function that investigates whether there is any selected item in
`tc->data`.

Earlier, I've been quite liberal in spreading these asserts around, to
guard against code paths that should have originally sorted `tc->data`
but by mistake didn't create `tc->sorted_index_map`.

They've been removed now, as they seem to be causing more trouble than
they're worth: the "sorting selected first" behaviour is only explicitly
there for proportional editing. With proportional editing disabled,
`tc->data` **only** contains selected items, and those are trivially
sorted first.

By now `tc->foreach_index_selected` can work without `sorted_index_map`;
if it is `nullptr`, it will assume that we're in the trivial case, and
that the array items can just be visited in index order.

Pull Request: https://projects.blender.org/blender/blender/pulls/141386
2025-07-07 15:44:12 +02:00
Jeroen Bakker
b4e8ee02cc Fix #141238: Vulkan: Crash during upload huge geometry
In case Blender was able to allocate a vertex buffer for huge geometry,
but isn't able to allocate its staging buffer it would crash. In this
case errors will be reported in the console.

This PR fixes this by clearing the data in stead of uploading.

Pull Request: https://projects.blender.org/blender/blender/pulls/141553
2025-07-07 15:33:42 +02:00
YimingWu
22e8980b01 Cleanup: Unused variables in grease_pencil_join_selection_exec
Introduced by 5acd62b39d. The variable is
unused in release and not affecting any existing logic downstream. So
removing it.
2025-07-07 20:48:07 +08:00
YimingWu
d47175d6fd Fix #141448: Geometry Nodes: UI panel property name trimming logic Fix
Previously in 95259228d9, property names
within geometry nodes panels are trimmed to make it less verbose if the
property name contains the parent panel's name as prefix, this didn't
take into account where property name can be the same as panel name, in
which case there will be an empty property name which is undesired. So
we should not trim the name in this case.

Pull Request: https://projects.blender.org/blender/blender/pulls/141500
2025-07-07 13:59:23 +02:00
YimingWu
5acd62b39d Fix #141513: Grease Pencil: Remove strokes joined from other layers
Previously when joining a stroke from other layers, those original
strokes are kept even when joining mode isn't "Join and Copy". Now the
operator will correctly remove the incoming strokes from their original
layers.

Pull Request: https://projects.blender.org/blender/blender/pulls/141527
2025-07-07 13:03:54 +02:00
Jacques Lucke
549e4c6274 Fix #139079: crash switching scene due to double depsgraph rebuild
The root cause of the crash was that currently the depsgraph does not support
being rebuilt twice without being evaluated in the meantime. While not ideal to
rebuild the depsgraph twice, it's really something I'd expect to work without
crashes/leaks.

The double-rebuild when switching the scene was introduced by b6e1afb6e1
which tagged the depsgraph relations indirectly. Tagging relations at that place
should be valid though. The same bug can easily be reproduced by explicitly
writing code that rebuilds the depsgraph twice as shown in
https://projects.blender.org/blender/blender/issues/139079#issuecomment-1615029.

So far, we've found two places that need to be fixed to properly support
rebuilding the depsgraph before it has been evaluated:
* `update_invalid_cow_pointers`: `previously_visible_components_mask` was used
  to check if the id is new and therefore not expanded yet. However, this check
  is wrong in the case when the depsgraph was not evaluated yet. Instead, check
  whether the ID is expanded directly. IDs which don't use copy-on-eval are
  still handled properly due to another existing check.
* `DepsgraphNodeBuilder::begin_build`: This just discarded
  allocated-but-not-expanded IDs without freeing them. Now they are freed when
  their ownership is not transferred to `IDInfo`.

See
https://projects.blender.org/blender/blender/issues/139079#issuecomment-1615029
for more details.

Pull Request: https://projects.blender.org/blender/blender/pulls/141199
2025-07-07 13:00:04 +02:00
Damien Picard
ca38e3be94 I18n: Use proper existing context for "Dimensions"
This occurrence of "Dimensions" uses the existing "Texture" translation
context.

Reported by Satoshi Yamasaki in #43295.

Pull Request: https://projects.blender.org/blender/blender/pulls/141491
2025-07-07 12:02:26 +02:00