Commit Graph

120453 Commits

Author SHA1 Message Date
Hans Goudey
29c623f857 Fix #140530: Crash after writing Grease Pencil drawings in new format
`blend_write_prepare` expects to work on a shallow copy of the
`CurvesGeometry` struct. This is necessary because it changes
the struct to contain only the layers being written. This is
particularly important with writing with the new format enabled,
where attributes are written as part of `AttributeStorage`.

Writing with a shallow copy of the struct also gives us the
flexibility to zero the runtime pointer in the written file which
is generally a good practice.

Pull Request: https://projects.blender.org/blender/blender/pulls/140560
2025-06-18 16:02:15 +02:00
Pratik Borhade
cf14be7644 Fix: Regression: Invert doesn't work with search filter in some UIList
For UILists that doesn't use `filter_items()`, search filter doesn't work
along with invert button. For filter_items, invert case is already
handled in filter_items_by_name. In absense of that function,
handle the invert case inside `UI_list_filter_and_sort_items`. Existing logic
is a bit wrong. Now flags are adjusted, i.e. when search string matches, check
for invert status to decide whether items should be in the list or not.

Pull Request: https://projects.blender.org/blender/blender/pulls/139523
2025-06-18 11:40:43 +02:00
Clément Foucault
234ff21a7b Fix #140490: EEVEE: Broken hair motion vectors
This was caused by a hash colision caused by an incorrect
auto conversion from `Object*` to `ObjectRef`. The `ObjectRef`
would then not contain any instancing data and would create
the same hash for the same particle system on each instance
(since only `foreach_hair_particle_handle` was constructing
`ObjectKey` from an `Object*` it did not affect the instance
itself).

Marking the incriminating constructor `explicit` to avoid
more issues. Changing the `ObjectKey` creation for psys to use
`ObjectRef` fixes the issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/140544
2025-06-18 10:46:27 +02:00
Philipp Oeser
b254a1ac36 Fix: Graph Editor box select selects non-visible handles
We should never select something that is hidden in the viewport.

Generally, there can be multiple reasons why keyframe handles are not
shown in the Graph Editor:
- the `View` > `Show Handles` option is disabled
- the `Only Show Selected Keyframes Handles` is enabled
- a keyframe `Interpolation`  method is anything but `Bezier`

This PR corrects the first.

Details:
- In `box_select_graphkeys()`, the `incl_handles` parameter is only
be passed to `initialize_box_select_key_editing_data()`
- add a separate `KEYFRAME_ITER_HANDLES_INVISIBLE` flag (representing
SIPO_NOHANDLES)
- "include_handles" purely represents operator setting / user intend now
- "final" decision about handles/their visibility is done in
`keyframe_ok_checks()` etc

For consistency, add "include_handles" option to Lasso/Circle as well

Part of #139314

Pull Request: https://projects.blender.org/blender/blender/pulls/139349
2025-06-18 07:54:51 +02:00
Campbell Barton
4dba0113fd Fix #140396: bmesh.ops.dissolve_edges fails to dissolve vertices
Add an optional init function which operators

An alternative to [0] which missed Python API support (causing #140451).
While that could be resolved, tracking which "slots" have been set
would have to be flagged on every map/hash insertion which seems
excessive and is prone to bmesh operators failing if the flag is ever
missed. Prefer a simpler init function so dissolve edges doesn't have
a zero threshold.

Also support multi-line comment blocks in the generated API docs.

[0]: bd3a66a416
2025-06-18 04:42:42 +00:00
Sybren A. Stüvel
67b0e05a62 Fix #139762: Deleting an F-Curve from NLA strip in tweak mode crashes
The "delete this F-Curve" function assumes that the F-Curve is either a
driver or contained in `adt->action`. This does not have to be true, as
the Action editor can also show F-Curves from other uses (for example an
NLA strip). The channel delete operator (`ANIM_OT_channels_delete`) now
takes this into account.

Pull Request: https://projects.blender.org/blender/blender/pulls/140291
2025-06-17 22:42:43 +02:00
wszqkzqk
3999975c29 Build: Add loong64 support in BLI_build_config.h
LoongArch is a new RISC ISA developed by Loongson, this adds the missing
entry to BLI_build_config.h. It has been verified to work on Arch Linux's
loong64 port.

Pull Request: https://projects.blender.org/blender/blender/pulls/130916
2025-06-17 20:20:26 +02:00
Brecht Van Lommel
03b1071bcb Fix: Invalid snprintf into the same string in recent bugfix
Mistake in 5b1126da66
2025-06-17 20:06:51 +02:00
Jesse Yurkovich
6f986e8c34 Fix #140515: Some pieces of Point Cloud support were still disabled
Certain aspects of Point Clouds were still guarded behind a
`WITH_POINTCLOUD` define.

Pull Request: https://projects.blender.org/blender/blender/pulls/140516
2025-06-17 18:46:08 +02:00
Philipp Oeser
adcea77c49 Fix #140257: Asset Browser Frame Selected wrong after a search
Also true (and reported) for the general File Browser.

In the implementation from 5a67407d5a it was noted that including the
active file was desirable(next to `FileSelection` `first` and `last` of
course).

`FileSelection` indices get correctly updated after search is altered/
cleared (by `file_current_selection_range_get`), the `FileSelectParams`
`active_file` however isnt.

This makes the framing go wrong when search is altered or cleared (it
uses an index from the previous/outdated filter result).
I case of the Asset Browser (in main) this was also obvious when you
looked at an active asset in the sidebar -> clearing a search (after
having selected something while searching) for example would make a
"completely different" asset active.

Since keeping track of a "previous" `active_file` (and trying to update
to an updated/correct index) turned out to be quite hairy, this PR goes
the route of actually clearing the `active_file` on search updates. Like
mentioned, this is still not ideal (at least for the Asset Browser, it
looses the "active" of something selected), but at least now you can
easily frame it again -- and is is better than in main (where "active"
would point to something completely unrelated and you could not even
frame it to click-activate it again).

Pull Request: https://projects.blender.org/blender/blender/pulls/140365
2025-06-17 16:31:40 +02:00
Brecht Van Lommel
5b1126da66 Fix #140375: Image editor save overwrites movie file
Create a good default name for saving individual frames of a movie file loaded
as an image datablock, instead of the movie file name.

Changes ImBuf to store the frame separate from the filepath, to implement this.
Seems more clear for ImBuf.filepath to be an actual filepath anyway.

Thanks to Jesse and Aras for investigating this bug.

Pull Request: https://projects.blender.org/blender/blender/pulls/140471
2025-06-17 14:15:19 +02:00
Clément Foucault
cb6901f287 Fix: EEVEE: Wrong logic for shader parallel compilation
The previous logic was not triggering parallel compilation
for DoF and Fast GI shaders. This led to slower initialization
time for the default shader preview or render.
2025-06-17 12:43:50 +02:00
Pratik Borhade
4bf1931fee Fix #139494: Regression: Filtering doesn't work with custom search prop
If block added in 52b8eba9eb actually
seems reduandant (invert still shows all elements for empty string).
Due to the `filter_byname` condition, custom property used for search
filtering was useless as UI_list_item_index_is_filtered_visible returned
true for all elements.

Pull Request: https://projects.blender.org/blender/blender/pulls/139518
2025-06-17 12:05:55 +02:00
Philipp Oeser
3ddd2dff37 Fix #140210: Edit Bone selection cycling wrong for active but unselected
Unlike object or posemode (where items not only need to be active but
also selected to be treated as a starting point for cycling through to
the next item behind it on the next click), armature editmode would
treat active (but unselected) bones as a starting point as well. Leading
to confusion if you just clear your selection prior.

For reference to the expected behavior, look at these comments in
`mouse_select_eval_buffer`

>/* Only exclude active object when it is selected. */

>/* When the active object is unselected or not in `buffer`, use the
nearest. */

Now for editbones, the way `get_nearest_editbonepoint` works, there were
actually two things preventing stuff from happening as expected:
- [1] we would still get "use_cycle" behavior if we have an unselected
(active) bone -> this is now checked for by looking at active bone
selection flags (NOTE: tip/root needs to be looked at as well). These
checks were once there, bd59781c66 removed them though.
- [2] without "use_cycle" behavior, we are still looping all hit bones
and there could be the situation where we could accept a first bone (in
the `bias > bias_max` condition -- that one could be the closest already
but does not set the `min_depth`), but continue to loop (now entering
the "bias == bias_max && do_nearest" condition and `min_depth` could
still be at INT_MAX) and accept a bone that is actually further away...
That logic is from 328ec2b172

Both points have now been addressed.

Pull Request: https://projects.blender.org/blender/blender/pulls/140348
2025-06-17 12:05:19 +02:00
Jeroen Bakker
ea1652dca3 Fix #140229: Vulkan: Crash during depth aware-navigation
Depth navigation sends many small render graphs to the device. It can be
that a subsequent render graph uses the same shader as the previous one
with the same descriptor set tracker. The descriptor set tracker didn't
cleared its full state and a subsequent render graph was generating
commands assuming that the device was in a certain state.

However it wasn't and a command to bind a descriptor set was skipped
resulting in a device out of bound write. Depending on the platform this
could overwrite any data on the GPU, including shader programs as the
select shader writes to a storage buffer. This clarifies why the issue
resulted in very odd and none consistent behavior.

This PR fixes this by clearing the VKPipelineData and
VKDescriptorTracker.

Pull Request: https://projects.blender.org/blender/blender/pulls/140526
2025-06-17 11:17:03 +02:00
Philipp Oeser
1203b726d1 Fix #140183: Add Armature Constraint (with target) wrong behavior
Two issues here:
- if only one bone is selected blender would create an **Empty** as
target (does not make sense as a target for an armature constraint
though)
- if other bones are also selected, none would be set up as a real
target for the Armature Constraint

So to resolve, change behavior in the following way:
- if only one bone is selected -> dont create a "dummy" target at all
(just like for `Clamp To` or `Spline IK`, does not really make sense to
create a default Curve / Armature in this case since the user would
always use something else)
- if you have another bone selected -> set it up as bone target in the
armature constraint for the user

For the second to work properly, we have to add a target to the armature
constraint "manually" (since armature constraints dont have a target by
default)

Pull Request: https://projects.blender.org/blender/blender/pulls/140200
2025-06-17 11:11:44 +02:00
Jeroen Bakker
701eb56f5e Fix #140129: Vulkan: Race condition render graph submission
When queueing render graphs for submission the adding of the queue was
not guarded. This could  still introduce a race condition, although
very unlikely.

Co-authored-by: Jorn Visser <git@jornvisser.com>

Pull Request: https://projects.blender.org/blender/blender/pulls/140517
2025-06-17 08:57:36 +02:00
Bastien Montagne
2e5b4a120a Fix #140083: Nodes: Never attempt to read default value from custom socket.
Pull Request: https://projects.blender.org/blender/blender/pulls/140459
2025-06-16 18:48:19 +02:00
Clément Foucault
168ef2331c Fix #140361: EEVEE: Volume viewport renderpass requires volume
The volume module was not enabled when the render pass
was needed. Forcing the module to be enabled fixes the issue.
2025-06-16 17:33:46 +02:00
Nathan Vegdahl
33b712f909 Core: Always use current open file for blend_name variable
Previously `blend_name` was using the same path to get its file name
as `//` used. However, the choice of path for `//` seems to be
bespokely chosen at each call site.  There may be a logic to it, but
if so it's not immediately clear what it is.

This PR changes `blend_name` to instead always use the currently open
("global") file path, making it well-defined and predictable for
users.

This also prepares better for PR #139438 for 5.0, which adds
`blend_name_lib`, which always uses the blend file that the ID owning
the path is linked from. Over-all this should be much more predictable
and controllable for users.

Pull Request: https://projects.blender.org/blender/blender/pulls/140474
2025-06-16 17:32:11 +02:00
Clément Foucault
52f986c2a9 Fix #140179: EEVEE: Vulkan crashing with complex procedural materials
Avoid crash by removing overlapping attributes.
Print error to the console.

Pull Request: https://projects.blender.org/blender/blender/pulls/140470
2025-06-16 16:38:13 +02:00
Bastien Montagne
c605c71a96 Fix #140451: Revert "Fix #140396: bmesh.ops.dissolve_edges fails to dissolve vertices"
The BMesh python API was fully broken by this commit.

While the fix seems to be reasonably simple, it is safer for now to revert
the faulty commit, as the breakage is fairly impactful for people using 4.5
and/or 5.0 daily builds.

This reverts commit bd3a66a416.
2025-06-16 16:18:41 +02:00
Jeroen Bakker
e8c5d26838 Fix #140285: Refactor clip editor drawing to fix asserts
- Removes asserts where polygon shaders are used to draw lines and
  points. This is incorrect and leads to asserts in Vulkan.
- Kept as close to the existing control flow. Didn't want to introduce
  regressions as this PR lands in 4.5

Pull Request: https://projects.blender.org/blender/blender/pulls/140337
2025-06-16 14:43:06 +02:00
Miguel Pozo
3c3fe0659a Fix #140416: Crash when undoing adding camera background movie clip
Fix free_movieclips_textures.
Release movieclips at the end of draw.
(Same behavior as Overlay Legacy)
2025-06-16 13:03:31 +02:00
Bastien Montagne
6ccdb8c06e I18N: Add comment about required manual sync in nodes code.
Nodes code uses direct access to enum property values definition
(outside of the RNA API) to generate UI (translated) messages, this is
risky/messy since the i18n context potentailly defined for the actual
RNA property is not available in these cases.
2025-06-16 12:43:10 +02:00
Damien Picard
00d9d58d77 I18n: Fix strange report formattings
A few reports used string formatting in a way which made translation
awkward, by splitting the message into several individually translated
submessages, instead of just one message with formatting markers.

Pull Request: https://projects.blender.org/blender/blender/pulls/139895
2025-06-16 12:39:06 +02:00
Damien Picard
ec22a91233 I18n: Allow translation of Bitwise Math node label
The Bitwise Math node's label uses a formatted string, where the
operation name was not translated.
2025-06-16 12:39:02 +02:00
Sybren A. Stüvel
953aaf1dae Fix: Pose Inbetweener crashes when bones have custom properties
Fix a crash in the inbetweener (and other similar tools) when bones have
custom properties, but no system properties. It just needed another
`nullptr` check.

Pull Request: https://projects.blender.org/blender/blender/pulls/140455
2025-06-16 12:10:47 +02:00
Julian Eisel
8717036405 Fix #140426: Saving new file creates empty catalog file next to .blend
When initially saving a file, we would now always create a catalog
definition file that would be writted to disk on file save. This
shouldn't be done if there are no new catalogs to write.
2025-06-16 12:07:01 +02:00
Aras Pranckevicius
81a1993614 Fix #140427: VSE crash with scene strips and prefetch on
Other call sites were guarding against null prefetch job, one was not
2025-06-16 12:13:14 +03:00
Clément Foucault
7da81b5f39 Fix #140450: Vulkan: profile.json files appears in home directory
Was caused by the shader compilation profiling not checking
for the profiler being enabled.
2025-06-16 11:02:18 +02:00
Omar Emara
976efdcac9 Compositor: Remove storage of Alpha Over node
This patch removes the storage of the Alpha Over node, since it is no
longer used. This is a continuation of b62ef2cdd6.

Pull Request: https://projects.blender.org/blender/blender/pulls/140359
2025-06-16 08:07:21 +02:00
Jacques Lucke
0937051d52 Fix: Nodes: bad user counting when creating node group
The newly created node tree already has one initial user
when it is created. So the user count does not have to be
increased when it's first assigned.
2025-06-16 06:31:21 +02:00
Guillermo Venegas
a8fdecc0a8 Fix: IO: FBX General import settings layout can't be re-enable
The `General` settings layout can be disabled by unchecking `use_custom_props`,
an since this button button is within this layout it can't be activated back.

NOTE: See that the button can be activated back if the checkbox is still
hovered after being unchecked, if the mouse moves out it can't be enabled back.

Pull Request: https://projects.blender.org/blender/blender/pulls/140228
2025-06-16 06:26:27 +02:00
YimingWu
ab4f5ef5f2 Fix #140161: UI: Use theme wireframe color by default
In Geometry Nodes workspace, the viewport didn't have wireframe color
type set to a valid value, now set default value to theme color for all
viewports.

Pull Request: https://projects.blender.org/blender/blender/pulls/140172
2025-06-15 12:54:10 +02:00
YimingWu
6756982f07 Fix #139873: Grease Pencil: Auto normalization on assign/remove operator
Auto normalization used to not work on assign/remove vertex group
operator, this was due to `BKE_object_defgroup_validmap_get` and
`vgroup_parray_alloc` did not handle grease pencil type objects. Now
added grease pencil cases in them and auto normalization works as
expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/139912
2025-06-15 12:50:13 +02:00
Pratik Borhade
f9e7769f7f UI: Use selected text theme of list item for tree view
If view items button is active, call `ui_layout_list_set_labels_active` to
set the `SELECT` flag on label button. Due to this flag being set, text_sel theme
color is copied to `wcol.text` (see `UI_SELECT` condition in `widget_state()`).
This `wcol.text` is later used inside `widget_draw_text()` for text color.

Pull Request: https://projects.blender.org/blender/blender/pulls/140330
2025-06-15 12:07:22 +02:00
Campbell Barton
bd3a66a416 Fix #140396: bmesh.ops.dissolve_edges fails to dissolve vertices
Support flagging BMesh operator slots as being used so it's possible
to use a non-zero fallback value for the edge-dissolve angle threshold.
2025-06-15 19:12:50 +10:00
Aras Pranckevicius
074fcfe1a5 Fix #138834: FBX importer sets pivots incorrectly in some cases
Fix the rest of #138834, pivot adjustment was not done
when rotation pivot and scaling pivot inside FBX were not matching.

Pull Request: https://projects.blender.org/blender/blender/pulls/140411
2025-06-14 21:14:27 +02:00
Aras Pranckevicius
6251f7f0b0 Fix #140336: VSE scene strips with sequencer in them are not playing
The intra-frame cache was not notified of the current frame number
when rendering VSE through a scene strip.
2025-06-14 21:11:54 +03:00
Campbell Barton
fb3b1043d3 Cleanup: spelling in comments (make check_spelling_*) 2025-06-14 16:01:04 +10:00
Campbell Barton
c482c52346 Cleanup: sort CMake file lists 2025-06-14 15:57:33 +10:00
Campbell Barton
bb5f6d437e Cleanup: sort DNA rename definitions 2025-06-14 15:55:41 +10:00
Campbell Barton
ce760b7f0b Fix NDOF panning in 2D views ignoring the delta time
The delta-time is used as a scale for panning in all other views.
2025-06-14 12:25:08 +10:00
Campbell Barton
a197b1811a Fix #140165: NDOF panning reversed
Regression in [0] caused NDOF panning to be reversed
and zoom to be inverted in the 3D viewport.

- Use 2D viewport behavior for cameras & rotation locked views
  since the navigation mode is not used in these cases.
- Restore the same zoom direction as 4.4x.

[0]: 64696cc699
2025-06-14 12:22:36 +10:00
Michael B Johnson
07342407d3 USD: Add support for Point Instancing during Export
Adds a Point Instancing exporter based on the existing
USDPointInstancerReader. Covers both round-trip and Blender-native
workflows. Exports 'Instance on Points' setups as USDGeomPointInstancer,
supporting objects, collections, and nested prototypes.

A warning is shown during export if invalid prototype references are
detected. These would occur if an instancer attempts to instance itself.

This feature is currently gated behind an off-by-default export option
(`use_instancing`) as there are still a few cases which can yield
incorrect results.

Further details in the PR.
Ref: #139758

Authored by Apple: Zili (Liz) Zhou

Pull Request: https://projects.blender.org/blender/blender/pulls/139760
2025-06-14 01:10:55 +02:00
Rob Blair
fc0b659066 Fix divide by zero in Bevel.
The [Fix #125024: Bevel offset - eliminate divide by 0] (#126309)
in response to [Bevel Modifier creates unwanted geometries] (#125024)
created "divide by 0" situations when checking for clamp overlap geometry
in the bevel modifier. This PR eliminates this undefined behavior.

Original PR by Rob Blair. Modified by make format and added
a needed include.
2025-06-13 10:47:56 -04:00
Jeroen Bakker
6899c2dbfd Fix #140342: Vulkan: Assert when quiting
When quiting Blender the timeline doesn't get updated and an assert is
triggered that the order isn't correct. The order isn't that important
anymore as the mechanism has been tested. The assert was useful during
initial development.

This PR removes the assert as it isn't valid in all cases.
2025-06-13 13:28:37 +02:00
Pratik Borhade
1d83e9bfe3 Fix #140224: Group ID in drag search of merge layer is not working
This is due to missing `make_available` callback for Group ID socket.
Use it to change the mode of the merge layer node so that socket is
available in `connect_available_socket()`

Pull Request: https://projects.blender.org/blender/blender/pulls/140251
2025-06-13 11:55:19 +02:00
Omar Emara
b62ef2cdd6 Compositor: Add forward compatibility for removed storage
This patch removes node init functions that currently exist only for
forward compatibility and moves the logic to the forward compatibility
section of node writing. This is to avoid allocating unused data
throughout the 5.x series.

Pull Request: https://projects.blender.org/blender/blender/pulls/140273
2025-06-13 11:15:51 +02:00