Commit Graph

123814 Commits

Author SHA1 Message Date
Bastien Montagne
861a174a82 Fix #148220: Scene 'Linked Copy' does not remap to newly copied data-block.
While more of a theoritical issue currently, this change is a
pre-requisite to support properly compo nodes duplication in 'linked
copy' case (see !148210).

Also add a basic unittest for this case.

Pull Request: https://projects.blender.org/blender/blender/pulls/148222
2025-10-17 14:17:42 +02:00
Jacques Lucke
ba0f73d076 Fix: crash writing undo step for grease pencil
This was missing from #148144.
2025-10-17 13:10:37 +02:00
Philipp Oeser
48dc788e6d Fix #145488: UI: Flipped rows/columns in custom matrix property
Since matrices are usually indexed **row first**, displaying matrices in
the UI seems flipped.
They are stored as flat arrays.
When `matrix[1][0]` is accessed via python, the logic from
`pyrna_py_from_array_index` will actually look up index 2 in the flat
array (rightfully so).

But UI code was flipped in that regard.
The second value in the flat array **should** show at row 1 column 0,
but it currently doesnt.

Now (hopefully) handled properly (not only in `ui_item_array` but also
made code in `ui_item_rna_size` detect proper row count for a `height`)

Pull Request: https://projects.blender.org/blender/blender/pulls/148197
2025-10-17 10:22:51 +02:00
Philipp Oeser
fca5bcbe46 Fix #146250: Some gizmos/widgets are continuously running updates
Reported for the geometry nodes gizmos, but in general `cage2d`,
`cage3d` and `arrow` were affected (so for example Forcefield arrows, UV
editing transform tool, Lamp angle gizmo, ...)

`gizmo_cage3d_modal`, `gizmo_cage2d_modal` and `gizmo_arrow_modal` add a
`WM_event_add_mousemove` which ... lets the modal run even if the mouse
does **not** move...

This seems to date back to d8f931c9b7 in the arrow gizmo, others
probably just copied from there (not the DialGizmo though), did not do
further git archeology.

Propose to just remove `WM_event_add_mousemove` (even though there
_might_ still be reasons for this -- could not spot any though...)

Pull Request: https://projects.blender.org/blender/blender/pulls/146310
2025-10-17 10:21:01 +02:00
Philipp Oeser
6536fd80fc Fix #144359: Scrolled down Asset Shelf prevents drag & drop in viewport.
The issue is in the `ED_region_overlap_isect_` family of functions I
believe. Their purpose is to check if a coordinate is in the
"non-transparent" or opaque parts of the overlapping region.

These are getting event coordinates (in window space), converted to
region relative space (substracting region->winrct).

Comparison is in view space (through `UI_view2d_region_to_view_y`)
to account for scrolling and zooming.

The thing where it goes wrong is that we are actually comparing to
`region->v2d.tot` (this can be huge, most of it not visible), where I
think we should be comparing to `region->v2d.cur` (that is the part that
is actually visible...)

Swapping `region->v2d.tot` with `region->v2d.cur` is what this PR does.

Pull Request: https://projects.blender.org/blender/blender/pulls/146032
2025-10-17 10:19:15 +02:00
Philipp Oeser
77819d77d2 Fix #146251: Moving masks via transform system does not update gizmos
Oversight in 4bede1b555

`transformApply` / `transformEnd` already gives us a `NC_MASK |
NA_EDITED` notifier (via `viewRedrawForce`), so listen to that in
`image_main_region_listener`.

NOTE: alternatively, we could send an appropriate notifier in
`special_aftertrans_update__mask` (or remove the condition from the one
that is already there), with the difference that the gizmo would only
update after the transform is confirmed -- which may or may not be
desired

Pull Request: https://projects.blender.org/blender/blender/pulls/146292
2025-10-17 10:16:49 +02:00
Eitan Traurig
070344c06f Fix #147924: Move on Axis dynamic uses tile size instead of dynamic size
Ref !147933
2025-10-17 15:10:12 +11:00
Sean Kim
fd3d9f2fa2 Fix #148064: Crash when using grease pencil fill tool
The recently introduced size, strength, and jitter pressure curves
affect most paint code. This exposed further odd behavior inside
`paint_brush_update` where the size pressure curve was being evaluated
even if the brush's size did not vary with pressure.

To fix this issue, this commit clarifies a few comments and updates the
code flow such that cached input values and evaluated pressure values
are used more consistently.

Pull Request: https://projects.blender.org/blender/blender/pulls/148077
2025-10-16 22:43:32 +02:00
Miguel Pozo
9d436aa31d Fix #147782: Workbench alpha imprecision
Regression from 1c41815c4d.

The log2/exp2 round-trip can cause imprecisions, which are especially
notable with the alpha channel.
This removes the round-trip conversion for the alpha channel.

Pull Request: https://projects.blender.org/blender/blender/pulls/148218
2025-10-16 20:50:20 +02:00
Clément Foucault
abdb682d37 Fix #141198: EEVEE: DOF is incorrect at low resolutions on AMD + Mesa
Caused by some driver synchronization bug.
Also fixes #147879.
2025-10-16 19:24:55 +02:00
Jacques Lucke
04fcc4126e Fix #147282: double clicking on value enters node group
This fix makes the enter-node-group operator pass through when interacting with a button.

The code is by @JulianEisel.

Pull Request: https://projects.blender.org/blender/blender/pulls/148133
2025-10-16 19:21:12 +02:00
Jacques Lucke
7075bbc176 Fix #148179: missing node group description in packed asset
The asset meta data containing the description was not packed and hence the
description was lost.

Pull Request: https://projects.blender.org/blender/blender/pulls/148221
2025-10-16 19:19:40 +02:00
Clément Foucault
6b0f57facf Fix #142285: 3D cursor placement ignores unselectable objects
This was caused by 3dfec1ff73
which introduce the new behavior. This was to fix workflows
using a lot of semi-transparent objects which made nagivation
difficult.

This patch first roll back to the previous behavior: The
unselectable object will affect depth-aware operators.

This patch introduces a new visibility property to remove
the influence of objects in all depth picking operations
and selection operations. However the object is still
selectable through non-drawing selection operators
(e.g. select by material) and through the outliner.
This is to adress the aforementionned navigation issues.

Pull Request: https://projects.blender.org/blender/blender/pulls/146706
2025-10-16 19:17:18 +02:00
Jeroen Bakker
e2dc63c5de Fix #147618: PyGPU incorrect colors when drawing images
644fb2b679 fixed a long standing issue
that offscreen example showed the wrong colors. However the fix assumes
that input texture color space is always sRGB.

This adds a shader variation that draws textures that are stored in scene referred
linear color space (like all of our Image data-block).

Co-authored-by: Clément Foucault <foucault.clem@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/147788
2025-10-16 19:12:16 +02:00
quackarooni
ce88d773db Fix: Nodes: bad ui for adding panel toggles
Adding panel toggles in nodegroups have somewhat of a UX antipattern. When
running the operator, it checks for conditions that indicate it should not run,
and if those are hit, it cancels execution and mentions the invalid condition in
the footer bar.

This is not ideal, the user should not have to call the operator to find out
whether it can be called.

Why it got implemented like this is likely a consequence of all interface items
being the same "New Item" operator. Poll functions cannot use operator
properties, so variants of the same operator cannot check for different
conditions for execution.

This is a problem for panel toggles, as they have more restrictions to when they
can be added that don't apply to other interface items.

This patch creates a separate operator for adding panel toggles. This allows the
condition checks to be implemented in the poll function, which enables greying
out the operator buttons and showing on tooltips what condition is invalid.

Pull Request: https://projects.blender.org/blender/blender/pulls/146379
2025-10-16 18:37:22 +02:00
Jacques Lucke
7ed85bfe17 Fix #148032: vertex/weight paint undo broken
The issue was that the data-blocks of two different undo steps were detected to
be identical, even if the attributes changed. That's because even if the
implicitly-shared data was different, they were turned into the same pointer by
cadb3fe5c5 on write.

This patch makes it so that for undo steps, implicitly shared data does not use
the pointer stability feature (in a sense, implicit-sharing itself provides
pointer stability for undo steps already).

The main tricky aspect is that we need to know if a pointer is implicitly shared
in `writestruct_at_address_nr` and oftentimes that's called before the
corresponding shared data is actually written with `BLO_write_shared`. The
solution is to enforce that the blend-write code has to know what pointers are
implicitly-shared before they are written the first time. The simplest way to
ensure that is to call `BLO_write_shared` first. However, that's not always
possible, especially when the pointer is directly embedded in an ID. Therefore,
there is a new `BLO_write_shared_tag` function that can be used in such cases.

The undo performance for the file in #141262 is still fixed with this change.

Pull Request: https://projects.blender.org/blender/blender/pulls/148144
2025-10-16 17:16:05 +02:00
Sybren A. Stüvel
c22db2251e Fix #111576: Unnecessary write operations on blender_assets.cats.txt
When saving asset catalogs to an already-existing file, only perform
that save when there were local changes to the catalogs. This prevents
unnecessary writes to the catalog definition file, as that can cause
conflicts when multiple Blender instances share the same asset library
(either directly or via Syncthing/Dropbox/etc.)

Pull Request: https://projects.blender.org/blender/blender/pulls/148205
2025-10-16 15:36:52 +02:00
Jorn Visser
7df175c326 Fix: Unused result warning
Check the result of the write function to avoid an unused result
warning.

Pull Request: https://projects.blender.org/blender/blender/pulls/148198
2025-10-16 15:29:03 +02:00
Campbell Barton
31035ae19f Fix #148189: linking relative paths fails to resolve path
Resolve regression in [0] which would attempt to use `//` when loading library files.

Expand the directories before use.

Ref !148193

[0]: 7bc7b7743b
2025-10-16 10:40:32 +00:00
Lukas Tönne
2588ea685a Fix #147860: Default input setting for node declarations is unintialized
This has ripple effects by making the "hide value" setting ineffective and
always hiding socket values as well as graying out the "hide value" node group
option.

Pull Request: https://projects.blender.org/blender/blender/pulls/148188
2025-10-16 12:14:29 +02:00
Christoph Lendenfeld
f4fd52796f Fix #148129: Bone Collection select/deselect not working
The bone collection operator was not updated to handle the new flag
which is now on the `bPoseChannel` instead of the `Bone`.

For this to work, the operator now needs the `bArmature` as well as the `Object`
and they need to be in sync. Additional code was added to the poll function
to ensure this is the case.

As a bonus, when working with multiple armatures this now works as expected
where only the bones of the active armature are selected even if the armature is
shared. The active object is determined by the last bone clicked.

Pull Request: https://projects.blender.org/blender/blender/pulls/148185
2025-10-16 11:34:21 +02:00
Damien Picard
a989592654 I18n: Manually extract more node socket enum items
These enum items are only used in node socket declarations, not
exposed to RNA, and not extracted automatically for translation.

Reported by Ye Gui in #43295.

Pull Request: https://projects.blender.org/blender/blender/pulls/148083
2025-10-16 10:59:09 +02:00
Damien Picard
6e5d12151d I18n: Translate missing sockets from gather node searches
When connecting node sockets, a search menu opens. Its items need to
be added, and translated manually. This commits adds a few missing
items from recent nodes.

It does the same for sockets coming from node group assets.

Reported by Ye Gui in #43295.

Pull Request: https://projects.blender.org/blender/blender/pulls/148079
2025-10-16 10:58:35 +02:00
Damien Picard
8bf46781b0 I18n: Translate brush direction enum items
Brush directions are dynamic, the enum can have different options
depending on brush type. This commit manually extracts the options.

The labels use the "Brush" translation context, to disambiguate
"Deflate", the operation, with the compression algorithm.

Also `smooth_direction_items` is moved inside
`rna_Brush_direction_itemf()`, since it is used only there, same as
the other brush direction items.

Reported by Ye Gui in #43295.

Pull Request: https://projects.blender.org/blender/blender/pulls/148081
2025-10-16 10:13:17 +02:00
Campbell Barton
2ca0c50397 Fix #148025: UV Overlap select doesn't work with select sync enabled
- Use uv_select_flush_from_tag_face to handle selection.
- Skip updating objects with no overlapping faces.

Ref !148181
2025-10-16 17:35:16 +11:00
Campbell Barton
5850fad63a Fix: UV box/lasso/circle selection fails with edge & face modes enabled
When select-sync was used with both edge & face modes enabled,
vertex selection logic was used which resulted in no visible selection.

Now edge selection is used when both edge and face modes are enabled.

Ref !148181
2025-10-16 17:35:16 +11:00
Campbell Barton
2808c411d7 Fix #148026: Box select pinned UV's fails with select-sync enabled
Implement pinned with select-sync (technically not a bug),
more an oversight in !138197.

Some subtle functional changes have been made.

- Select pinned now only works in vertex select mode
  since previously it was possible to select vertices in edge/face modes
  where the selection wasn't displayed.
- The island selection option is ignored when selecting pinned.
- The select pinned operator wasn't working with select sync edge/face
  modes. Exits with an error instead.

Ref !148181
2025-10-16 17:35:16 +11:00
John Kiril Swenson
a8e64f9a22 Fix: VSE: Crash from prefetch scene strip infinite recursion
PRs #147511 and #147595 ensured that any check for scene strip renders
in the prefetch thread would also recurse into "sequencer-type" scene
strips, but this introduced the potential for an infinite recursion.
Fix by using `SeqRenderState` to detect such a recursion.

Also remove unused `seqbasep` context member in `PrefetchJob`, and
add a check for non-nullptr `Editing`, fixing a crash where the scene was
present without an `Editing` counterpart.

Pull Request: https://projects.blender.org/blender/blender/pulls/147949
2025-10-16 01:55:08 +02:00
John Kiril Swenson
60d0cfdfe4 Fix #147701: VSE: Can't select markers when scene and sequencer scene differ
Add a simple check to the Marker keymap poll. Since there's no `bContext`
passed to the function we can reconstruct it from the workspace.

We can exit early if there is no sequencer scene (when no markers are
guaranteed). View layer can remain the same since it only applies in the
`SPACE_ACTION` case.

Pull Request: https://projects.blender.org/blender/blender/pulls/147903
2025-10-16 01:51:01 +02:00
Richard Antalik
8a0622ac68 Fix #148121: Thumbnails are refreshed when adding keyframes to strip
When strip property was animated, all caches were wiped. However, it is
not necessary to wipe raw cache or thumbnail cache.

Pull Request: https://projects.blender.org/blender/blender/pulls/148162
2025-10-15 21:46:30 +02:00
YimingWu
db96265568 Fix #148061: Prevent unknown socket type from crashing when reading file
`socket.socket_typeinfo()` can be nullptr when reading blend files that
contains custom socket types that are not registered yet. This fix
prevents crashing when this happenes (but the socket will stay
unregistered).

Pull Request: https://projects.blender.org/blender/blender/pulls/148103
2025-10-15 16:54:08 +02:00
Damien Picard
cf7713aac6 I18n: Disambiguate "Second", the unit, not the ordinal
Reported by Alexandr Fatih in #43295.

Pull Request: https://projects.blender.org/blender/blender/pulls/148085
2025-10-15 16:26:48 +02:00
Damien Picard
90e2dfd2e3 I18n: Translate dynamic operator descriptions
The descriptions for `POSELIB_OT_asset_modify` and
`GEOMETRY_OT_execute_node_group` are dynamic. They were already
extracted, but the translation did not happen in the description
function.

This commit adds the appropriate `TIP_` translation macro.

Reported by Ye Gui in #43295.
2025-10-15 16:26:46 +02:00
Damien Picard
c36c103389 I18n: Translate "Unassigned Node Tools" tool node menu
The "Unassigned Node Tools" menu type is declared manually in a
function, and its label is not automatically translated. This commit
extracts it using `N_()`. Note that its description was already
extracted the same way.

Reported by Ye Gui in #43295.
2025-10-15 16:26:46 +02:00
Damien Picard
5e6ea2fa78 I18n: Disambiguate "Value" in the context of colors 2025-10-15 16:26:46 +02:00
Damien Picard
51a0d1bf1c I18n: Translate curve falloffs using existing context
In particular, "Inverse Square" is only extracted in the Curve
translation context.

Reported by Ye Gui in #43295.
2025-10-15 16:26:46 +02:00
Julian Eisel
ba71402e24 Fix: Undefined behavior when using UI list or tree-view scrollbar
A scrollbar button would be cast to a number-slider button, and values from
this memory used for scrollbar specific calculations. Looks like an error from
809499a3d0.

In practice the error wouldn't be visible, since the actually used value would
by chance be the intended value, from what I can tell. That's because
`uiButNumberSlider.step_size` and `uiButScrollBar.visual_height` have the same
memory offset within the button memory.
2025-10-15 16:21:58 +02:00
илья _
7b3737f1e9 Fix: Mesh: Wrong corner edge indices in result of edge generation
Instead of reordering edges to be able to map them with hash sets, new
edges order (since 157e7e0351) is kept as-is in order to not
touch edge attributes. In early return in case of correct mesh this new
ordering was missed. This was found in file from #147694.

Pull Request: https://projects.blender.org/blender/blender/pulls/147872
2025-10-15 15:39:11 +02:00
Bastien Montagne
40e61d4240 Fix #147978: Missed conversion to SystemProperties for children bones.
Forgot that the Armature's bones list only contain root bones...

Fix the versioning code.

Also adding a 'recovery' extra versioning step for files that may have
already been opened and re-saved in Blender 5.0 (though this step is
not 100% handling all cases, in case some script or add-on already
created some system properties in a bone in 5.0, the existing user
properties from 4.5 and before won't be copied over anymore).

Pull Request: https://projects.blender.org/blender/blender/pulls/148125
2025-10-15 15:09:30 +02:00
Sybren A. Stüvel
bbf40d214c Fix #147729: Crash scrubbing w/ snapping to sec and FPS < 0.5
Fix playhead snapping to seconds, when the frame rate is less than 0.5
FPS.

This makes it possible to snap to fractions of frames, to support setups
with multiple seconds per frame. Of course this only has any effect
(apart from not crashing) when sub-frames are enabled.

I've also added unit tests, and verified that the values are the same
from before this refactor.

Pull Request: https://projects.blender.org/blender/blender/pulls/148074
2025-10-15 12:54:36 +02:00
Bastien Montagne
3f7db9c4b7 Fix #147759: Do not delete a library if it contains the active scene.
Supporting this is fairly involved (see #147759 comments and !147827),
so for 5.0 and active LTSs releases, best is to not delete a library if
it contains the active scene.

Pull Request: https://projects.blender.org/blender/blender/pulls/147831
2025-10-15 11:40:29 +02:00
Bastien Montagne
408a0b58d4 Fix #147317 Crash on undo/redo with PackedData.
The issue here was that when an archive library ID is read from
blendfile (memfile undo buffer in that case), a new split main is
immediately created for it in `direct_link_library`, and the newly
read Library is assigned to its `Main::curlib` pointer.

However, in undo readfile code, when an old matching ID is found, the
new data is moved into that old address, to avoid modifying all other
unchanged ID using that re-read data-block.

For (archive) libraries, it means that their split main `curlib` pointer
also needs to be re-assigned to the re-used old address.

Pull Request: https://projects.blender.org/blender/blender/pulls/147744
2025-10-15 11:09:01 +02:00
Pratik Borhade
a5618366cb Fix #147993: Space bar not playing on Playback Controls footer
Possibly caused by 2ae953d7f5
Include `ED_KEYMAP_FRAMES` flag for footer region. This will
listen/handle keymap events of spacebar when mouse is over the
footer region.

Pull Request: https://projects.blender.org/blender/blender/pulls/148021
2025-10-15 11:06:43 +02:00
Campbell Barton
e809e6364d PyAPI: prevent indices below -1 being used by StructRNA.path_from_module
Disable this as RNA paths don't support Python-style negative indexing.

Ref !147255
2025-10-15 07:59:23 +00:00
Campbell Barton
be43077b1b Fix: crash printing integers in IDP_reprN
Regression in [0] caused printing integers to crash.
While this function isn't widely used it could crash logging
key-map items.

Also add tests for IDP_reprN.

Ref !148109

[0]: 92cf9dd2f2
2025-10-15 07:46:58 +00:00
Campbell Barton
7bc7b7743b Fix #147984: "Open Image" button always creates absolute file path
Before [0] this was read from the filepath, however some sequencer
operators only defined a `directory` & `files` and would attempt
to use a non-existent `filepath` property to detect if the path
was relative.

Resolve by making the directory relative as well as the filepath.

Ref !148106

[0]: 7d67113a8a
2025-10-15 07:09:59 +00:00
Harley Acheson
75e06730a8 Fix #147684: Close Tooltips When Out of Menu Bounds
With #145523 it is possible to have a tooltip open on a menu or popup
and it will not go away when expected. This PR removes any tooltips if
you move out of the menu item bounds.

Pull Request: https://projects.blender.org/blender/blender/pulls/148099
2025-10-15 03:14:17 +02:00
Jorn Visser
b3ba6465f4 Fix #139387: Crash reading invalid images from network drives on WIN32
Improve mmap handling of IO errors on WIN32.

Make MMAP gracefully handle IO errors on Windows by replacing the
mapping with zeros using a vectored exception handler when an
EXCEPTION_IN_PAGE_ERROR is raised. This is similar to how such errors
are handled on non-Windows platforms.

On Windows, this is implemented by first creating a placeholder
allocation and then mapping the file into it. When an error occurs, the
exception handler unmaps the file, keeping the placeholder intact, and
creates an anonymous mapping into it, after which execution can
continue.

Since some required functions don't exist on older Windows versions,
the error handling will only work on Windows 10, version 1803 or newer.

Ref !139739
2025-10-14 22:38:10 +00:00
Hans Goudey
8be01c2ce0 Fix #147270: Smooth by angle asset detection broken
Previous attempts:
- 6d884e0da5
- 80e8493c11

It seems `BLI_path_normalize` was doing more than necessary and that
was getting in the way. This PR adds an automated test to avoid the issue
in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/148069
2025-10-14 20:50:36 +02:00
Harley Acheson
8b726ad83d Fix #148030: Right Side Corner Zone Width Change
With #144591 it was not my intent to increase the width of the right-
side corner action zones when visible "Corner Handles" are enabled. It
is only the left side that gains the icon so making the right side
wider only interferes with other content. This PR just fixes this by
defining different widths for right versus left zones.

Pull Request: https://projects.blender.org/blender/blender/pulls/148076
2025-10-14 19:58:04 +02:00