Commit Graph

152363 Commits

Author SHA1 Message Date
Hans Goudey
21f0dace48 Refactor: Make CD_TYPE_AS_MASK into a function with typed argument
So that misuse of this will result in build errors instead of bugs
(this change found three places like that).
2025-07-18 13:23:03 -04:00
Hans Goudey
4008b2dcb5 Cleanup: Remove unused attribute RNA function 2025-07-18 13:23:03 -04:00
Richard Antalik
577543c185 Fix #141503: Double click in file browser adds strip to the cursor
This happens, because after double clicking, release event was not yet
processed when `seq_slide` operator is executed.

There is `release_confirm` property to avoid this behavior, which wasn't
set to false.

Pull Request: https://projects.blender.org/blender/blender/pulls/142373
2025-07-18 19:14:49 +02:00
Hans Goudey
8cc29b9cd4 Fix: Build error in lite build
Caused by 0396316fa4
2025-07-18 12:04:58 -04:00
Falk David
11d2f48882 Fix #141887: Crash/assert hit after reading Grease Pencil
Since 5.0 (subversion 33) `CurvesGeometry` data is read from and written
to the new attribute storage. See 68759af516.

For backwards compatibility, the `CustomData curve_data`
became `curve_data_legacy` and was only read and then converted in
the versioning code to the attribute storage format.

But since `CurvesGeometry::blend_read` is still reading
`curve_data_legacy`, we need to ensure that this data is valid.

When e.g. duplicating `CurvesGeometry`, the `curve_data_legacy` was left
uninitialized, so in an invalid state. Then the writing code would write
the embedded `CustomData` struct and the reading code would fail.

This could in theory also happen for other IDs that store legacy
custom data.

To ensure that the data is valid when reading, we do the following:
1) After the conversion code ran, we reset the legacy data. This makes
sure that we don't keep the legacy data around at runtime and
potentially when writing the embedded struct.
2) Before writing, we also reset the legacy data. This makes sure that
in case there is some garbage data in the unused struct (e.g. from
copying the ID), we don't write the garbage to file.

Pull Request: https://projects.blender.org/blender/blender/pulls/142327
2025-07-18 17:55:36 +02:00
Philipp Oeser
e34f5a1d99 Fix #142326: Manifold boolean with plane ignores object transforms
To resolve, simply pass the matrix to `is_plane` and transform the
points before creating a plane from them.

NOTE: we also have a crash in main when the plane is "outside" the
target, will report that separately.

Pull Request: https://projects.blender.org/blender/blender/pulls/142336
2025-07-18 17:54:22 +02:00
Sebastian Herholz
20e0fed7da Cycles: Fixing wrong PDF evaluation when BSDF closures are excluded by the light source
Pull Request: https://projects.blender.org/blender/blender/pulls/142323
2025-07-18 17:13:54 +02:00
Richard Antalik
a002fa5efa Cleanup: Format 2025-07-18 17:07:45 +02:00
Richard Antalik
0396316fa4 Fix #141084: Sound glitches in render with equalizer
Ultimately, the issue was caused by updating sound sequence handle in
`AUD_SequenceEntry_setSound` on each new frame regardless if the
modifier data has changed.

This commit fixes the issue by implementing a means for modifiers to
check, if their parameters or inputs are changed.
This is done by storing these parameters in `StripModifierDataRuntime`
struct, that is shared between all modifier types. This is not ideal,
but it significantly simplifies dependency graph runtime store/restore
code.
Function `strip_update_sound_modifiers` passes boolean `needs_update`
to strip stack update functions. If any needs to be updated, it sets
value of `needs_update` to true allowing following update functions to
skip parameter checking to speed up the process.

Original code updated sound sequence handle twice. Once by function
`BKE_sound_update_scene_sound` then by `strip_update_sound_modifiers`.
If sound modifier is used, only `strip_update_sound_modifiers` needs to
be called, so there is condition to decide which one of these functions
is called.

Also fixes #139605

Pull Request: https://projects.blender.org/blender/blender/pulls/141595
2025-07-18 16:34:09 +02:00
Pratik Borhade
ef89c75382 Fix: Grease Pencil: Wrong layer attributes after reorder
Reordering layer nodes by drag-drop, move up/down, add new etc. swaps
layer attributes with wrong layers. This is due to mistake in map
`new_by_old_map`. Values of this map is used as indices in src array.
And keys are indices of dst array. Expected behavior is to copy attribute from
old position (`layer_i_old`) of src array to new position (`layer_i_new`) of
dst array. See: `array_utils::gather`.

Noticed during !141772.

Pull Request: https://projects.blender.org/blender/blender/pulls/141935
2025-07-18 16:30:41 +02:00
Jacques Lucke
20eaa1b1b0 Fix: Attributes: missing null check in when accessing attribute for write 2025-07-18 16:21:25 +02:00
Omar Emara
d18c9f38e0 Cleanup: Remove unused Viewer node ID member
The ID member of the Viewer node was assigned the viewer image ID. But
that member is not actually used by node execution code, so it can be
removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/142356
2025-07-18 16:18:53 +02:00
Falk David
99f3beb63f Refactor: VSE: Use new scene context function
This PR switches out the internal scene context function
used from the sequencer. This is done in preparation for
#140271.

Using a separate context function allows us to keep the
existing `context.scene` to refer to the active scene
and use a separate context member to refer to the
sequencer scene in the workspace (which is added in #140271).

Previous attempts simply overrode the `context.scene`
to refer to a different scene than the active one in the window.
This has two issues:
1) Any operator that wants to use the active scene in the window
  can't do it in the context of the sequencer. This is a problem for
  example for poll functions of operators that don't have anything to
  do with the sequencer.
2) For better or for worse, Blender expects the `context.scene` to
  always exist. For the sequencer, we'd like to possibly have no
  sequence selected.

Using a different context member for the sequencer has some
advantages:
1) Although we have to change quite a few places, it's limited to the
  sequencer. We don't have to change other parts of Blender to make
  things work.
2) It allows us to prepare for the future when we might want to
 separate the VSE from the scene. This is a step in that direction.
 Having a different context function makes it easy to find the places
 that would need to be refactored.

Pull Request: https://projects.blender.org/blender/blender/pulls/141271
2025-07-18 16:17:47 +02:00
Brecht Van Lommel
87ff645f5d Fix: Cycles preferences Python error after recent changes
Assigning properties in PropertyGroup has become more strict, define it in
__slots__ since it's a runtime property.

Pull Request: https://projects.blender.org/blender/blender/pulls/142357
2025-07-18 16:07:53 +02:00
Clément Foucault
b77d4a8f60 Fix #142259: Overlay: Velocity drawing outside of cache range causes crash
The check for ensuring active frame is in cache range was
wrong and would still try to draw the velocity.

Candidate for 4.5 LTS.

Pull Request: https://projects.blender.org/blender/blender/pulls/142332
2025-07-18 15:59:53 +02:00
Bastien Montagne
f4671fd3ca Buildbot MacOS: Increase xcode version to 16.3
tested several time on the buildbot, everything seems to be fine. And it allows enabling sanitizer builds for macos.

Pull Request: https://projects.blender.org/blender/blender/pulls/141949
2025-07-18 15:56:26 +02:00
Dawid-Kurek
ccd619bdb2 Hydra: Pass camera's custom croperties to render delegate
Makes it possible to read custom camera properties in a render delegate,
e.g with HdSceneDelegate::GetCameraParamValue().

Pull Request: https://projects.blender.org/blender/blender/pulls/138918
2025-07-18 15:55:18 +02:00
Omar Emara
6aa9cc56a0 Cleanup: Remove node recalculate flags code
This patch removes the compositor node recalculate flags and their
corresponding code, they do not have any effect, as the flag is not
used.

Pull Request: https://projects.blender.org/blender/blender/pulls/142343
2025-07-18 15:39:45 +02:00
Miguel Pozo
f62bc68a69 Fix #141781: EEVEE: IBL broken on Intel Iris 580
The shader was missing barriers compared to the old code.

Candidate for 4.5 LTS backport.

Co-authored-by: Clément Foucault <fclem@noreply.localhost>
Pull Request: https://projects.blender.org/blender/blender/pulls/141971
2025-07-18 15:29:35 +02:00
Guillermo Venegas
9c98ea1a18 Refactor: UI: Make button type params typed enums
This converts `eButType` and `eButPointerType` as typed enums.

This improves a bit `uiDefBut` self-documentation by taking an
struct with `ButType` and `ButPointerType` types, instead of
using a single `int` to write both enum types and bit index.

Almost all other `uiDefBut*` functions take just a `ButType`
parameter now.

`uiDefButI` for example is equivalent to:
`uiDefBut({ButType(type), ButPointerType::Int},...);`

Pull Request: https://projects.blender.org/blender/blender/pulls/142132
2025-07-18 13:12:16 +02:00
Falk David
20383e4d82 Python: Rename legacy Grease Pencil types to Annotation
This renames the legacy Grease Pencil python types to what
they are used for now: Annotations!

## Updated types
| Before | After |
| --- | --- |
| `bpy.types.GPencilStrokePoint` | `bpy.types.AnnotationStrokePoint` |
| `bpy.types.GPencilStroke` | `bpy.types.AnnotationStroke` |
| `bpy.types.GPencilFrame` | `bpy.types.AnnotationFrame` |
| `bpy.types.GPencilFrames` | `bpy.types.AnnotationFrames` |
| `bpy.types.GPencilLayer` | `bpy.types.AnnotationLayer` |
| `bpy.types.GPencilLayers` | `bpy.types.AnnotationLayers` |
| `bpy.types.GreasePencil` | `bpy.types.Annotation` |
| `bpy.types.BlendDataGreasePencils` | `bpy.types.BlendDataAnnotations` |

## Updated properties
| Before | After |
| --- | --- |
| `bpy.data.grease_pencils` | `bpy.types.annotations` |
| `MovieClip.grease_pencil` | `MovieClip.annotation` |
| `NodeTree.grease_pencil` | `NodeTree.annotation` |
| `Scene.grease_pencil` | `Scene.annotation` |
| `SpaceImageEditor.grease_pencil` | `SpaceImageEditor.annotation` |
| `SpaceSequenceEditor.grease_pencil` | `SpaceSequenceEditor.annotation` |
| `MovieTrackingTrack.grease_pencil` | `MovieTrackingTrack.annotation` |

Pull Request: https://projects.blender.org/blender/blender/pulls/142236
2025-07-18 12:57:01 +02:00
Omar Emara
42fbb6149c Fix: Assert in Menu Switch node
Blender asserts when updating declaration of Menu Switch node, that's
because a compositor specific function always ran. Fix this by running
for compositor node trees only.

Pull Request: https://projects.blender.org/blender/blender/pulls/142331
2025-07-18 12:32:30 +02:00
Clément Foucault
80b2302ec5 Fix #141980: Overlay: Curves in EDIT mode appear thinner and have no AA
This was caused by the drawing order being changed in 669a51904e
which made the edit wireframe draw after the regular wireframe.

The edit wireframe didn't output any AA wire data and would
remove any AA wire data written by the wireframe drawing.

This patch adds the correct wire AA data in the edit curve
drawing.

Candidate for 4.5 LTS backport.

Pull Request: https://projects.blender.org/blender/blender/pulls/142055
2025-07-18 11:23:44 +02:00
Michael Jones
8077384e3a Cycles: Improve Metal kernel specialisation
This improves the existing scene specialisation mechanism by replacing "kernel_data.kernel_features" with a function constant. It doesn't cause any additional compilation requests, but allows the backend compiler to eliminate more dead code. An additional compiler hint is provided for dead-stripping "volume_stack_enter_exit" which results in slightly faster rendering of non-volumetric scenes.

Pull Request: https://projects.blender.org/blender/blender/pulls/142235
2025-07-18 11:18:43 +02:00
Omar Emara
a565e96f6c Compositor: Support Menu socket and Menu Switch node
This patch adds support for menu socket in the compositor as well as
the Menu Switch node from Geometry Nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/141792
2025-07-18 11:08:30 +02:00
Falk David
5194c7d0df Cleanup: Fix typo 2025-07-18 10:58:36 +02:00
Falk David
d2f4d80ac9 Fix #142056: Grease Pencil: Assert on duplicating layer
The asserts were added in 45ab790e80
for better error detection.

The assert was happening because the duplicated layer
was referencing frames of the source layer by default,
causing the actual user counts of the drawings to be
in an invalid state (they they were getting fixed
after the call to `duplicate_layer`, but they could remain
invalid! ).

To fix this, we ensure that the user counts are correct
after calling `duplicate_layer`. New parameters are added
to allow duplicating the frames (with empty drawings) or
duplicating the frames and the drawings.

Pull Request: https://projects.blender.org/blender/blender/pulls/142201
2025-07-18 10:37:46 +02:00
Habib Gahbiche
67ffbcd0ee UI: Rename "Z" pass to "Depth"
This is a UI change only. The Python API still uses `use_pass_z` to
preserve forward and backward compatibility.

The compositor still uses "Z" to refer to depth in the Z-Combine Node.
This is addressed separately in
https://projects.blender.org/blender/blender/pulls/141676

Pull Request: https://projects.blender.org/blender/blender/pulls/141675
2025-07-18 10:27:29 +02:00
Mattias Fredriksson
2ea7d45f6e Cleanup: Improve output from OBJ export tests
Improves output from tests comparing export results to the golden
example file:

- Prints which of the files that are empty and/or has no newline.
- Prints a message when there is a mismatch in file length.
- Clarifies that the inner compare loop only compares up to shortest string.
- Prints the name of the failing golden file, indicating if it was the obj
  or mtl file that failed.

Pull Request: https://projects.blender.org/blender/blender/pulls/141958
2025-07-18 09:54:20 +02:00
Clément Foucault
a361e61f23 Fix #142217: EEVEE: Missing deformation motion blur in first viewport
The `VelocityGeometryData::pos_buf_get()` is returning `nullptr`
because the batch it not yet ready during the sync phase.
But it is after the first viewport has been drawn.

The fix is to have a different function that return
true if the data will be available.

Candidate for 4.5 LTS backport.

Pull Request: https://projects.blender.org/blender/blender/pulls/142238
2025-07-18 09:48:49 +02:00
Alaska
f278ac0419 Report template: Add a mandatory checkbox confirming the user has filled out the bug report form
To combat the recent increase of low quality reports, this commit
adjusts the bug report template to include a checkbox users must tick
before they can submit the bug report. The checkbox asks if they have
filled out the bug report form with all the relevant information.

Pull Request: https://projects.blender.org/blender/blender/pulls/142219
2025-07-18 08:35:56 +02:00
Jacques Lucke
c1f4b6e9d8 Nodes: Python: show idname in node tooltip
Currently, it's hard to figure out the idname of a node when just looking at it
in the node editor. while most users don't need this information, it's very
useful for Python developers.

This patch adds the node idname to the tooltip that shows up when hovering over
the node header. It only shows if "Python Tooltips" is enabled in the
preferences.

This also fixes a bug where the dynamic node description wouldn't show when the
node is collapsed.

Pull Request: https://projects.blender.org/blender/blender/pulls/142178
2025-07-18 06:19:18 +02:00
Campbell Barton
751cfe4a74 GHOST/Wayland: invert cursor color, pre-multiply alpha
- Cursors in wayland are expected to use pre-multiplied alpha.
  Note that cursor generators create straight alpha,
  pre multiplier in the wayland backend.
- Invert cursor colors on Wayland since dark cursors are often default,
  this could use dark theme settings in the future.
2025-07-18 14:13:38 +10:00
Campbell Barton
4e3b58423c Cleanup: use snake case for GHOST's can_invert_color argument 2025-07-18 12:53:32 +10:00
Campbell Barton
c52c8874e9 GHOST/Wayland: scalable vector cursor support via cursor-generators
Support showing vector cursors at the appropriate size based on each
monitors DPI.

This solves incorrectly sized cursors with Hi-DPI outputs as well as
supporting outputs with different DPI's.

Instead of passing pixel data, pass an object that can generate cursors,
GHOST/Wayland can then ensure the correct size is used based on the
display the cursor is shown on.

While may sound overly complicated it actually simplifies displaying
cursors on Wayland, especially for multiple monitors at different DPI's.
Showing cursors at higher or lower resolutions than the monitor's DPI
also behaves differently on GNOME & Plasma, resulting in situations
where the cursor would show larger/smaller than expected.

Details:

- Take advantage of the recently added SVG cursors & BLF time cursor
  !140990 & !141367.
- Setting bitmap cursors via GHOST_SetCustomCursorShape is now a no-op
  for Wayland since it's no longer used. This was supported in an
  earlier version of this PR and could be restored if needed.
- While fractional scaling works it relies on the compositor downscaling
  the cursors. Ideally they would be rendered at the target size but
  this isn't a priority as the difference isn't noticeable.

Ref !141597
2025-07-18 12:38:52 +10:00
Campbell Barton
9d41b04aec Cleanup: quiet warnings, typo 2025-07-18 12:03:53 +10:00
Campbell Barton
98dcd0c91e Build: unbreak WITH_HEADLESS, !WITH_PYTHON configurations 2025-07-18 12:01:43 +10:00
Campbell Barton
ce5c54fef6 Fix #128169: Memory leak in bpy.data.meshes.new_from_object
Resolve leak in new_from_object when preserve_all_data_layers=True and
a sub-surfaced mesh.

A copy was made, then BKE_mesh_wrapper_ensure_subdivision would return
the "mesh_eval" of the copy, leaking the mesh passed to
BKE_mesh_wrapper_ensure_subdivision.

Ref !142176
2025-07-18 11:30:50 +10:00
Sean Kim
a3aa47ecec Cleanup: Add comment to wmWindow about pixelsize
Performing operations based on window size in terms of pixel units has a
high chance of resulting in unwanted behavior for macOS, due to HiDPI
displays.

This commit adds an API warning suggesting against usage of the raw
`sizex` and `sizey` values.

Related to #141982

Pull Request: https://projects.blender.org/blender/blender/pulls/142274
2025-07-18 01:12:15 +02:00
Sean Kim
245025480f Fix #141827: Crash when switching from edit to sculpt mode when hidden
When switching modes, the active object visibility is used to determine
whether or not the mode can be entered. Whether or not this object is
null or not is dependent on the current mode. Object Mode uses the
underlying visibility, whereas other modes do not. When
`mode_compat_set` is used, the active object is switched to object mode,
causing `CTX_data_active_base` to be null.

To fix this immediate issue and prevent further refactors from
potentially reintroducing it, this commit makes a number of changes:

* Clarifies the `object::mode_compat_set` function docstring in
  ED_object.hh
* Makes `object::mode_compat_set` the last operator check
* Uses `BKE_view_layer_base_find` instead of `CTX_data_active_base`
  since both necessary parameters are already on-hand in the function.

Pull Request: https://projects.blender.org/blender/blender/pulls/141985
2025-07-18 00:26:12 +02:00
Brecht Van Lommel
df6d6c0932 Refactor: Cycles: Use logging system for GPU error print
Pull Request: https://projects.blender.org/blender/blender/pulls/142257
2025-07-17 21:14:30 +02:00
Brecht Van Lommel
6f8eb2a1af Fix #142233: Cycles crash due to wrong node type registration order
This was exposed by NanoVDB changes. Properly ensure the base type is
created before the derived type.

Pull Request: https://projects.blender.org/blender/blender/pulls/142261
2025-07-17 21:13:59 +02:00
Jesse Yurkovich
84367f8cb9 Fix #142084: Importing broken USD skeletons can crash
The repro file in question contained invalid paths for the USD Skeleton.
This was not detected in our import code which proceeded to create bones
with empty (`""`), incorrect, names and subsequently allowed the
rest-pose setup to use non-existent bones during processing.

The primary fix here is to ensure that all incoming joint paths are both
valid and unique[1]. A secondary fix is made to the rest-pose function
to use our joint-to-bone map to ensure we are using the correct bone
names.

[1] https://openusd.org/release/api/class_usd_skel_skeleton.html#aa6bf8297f4aae6de9fbf1b784c524d30

Pull Request: https://projects.blender.org/blender/blender/pulls/142133
2025-07-17 19:49:29 +02:00
Jesse Yurkovich
1d2c1d2fa7 Fix #141718: Discontinuous rotations on some USD skeleton imports
Due to ambiguity when decomposing the incoming skeleton joint matrix,
it's possible for the returned quaternion rotation to be "flipped" from
the perspective of prior/future frames due to the quaternion
double-cover property. This would manifest as glitchy animations and
subtly incorrect motion blur results during render.

This PR implements the traditional mitigation of comparing with the
prior frame's rotation data and negating the quat if necessary. An
alternate method to instead compare with the rest positions was
attempted but it still allowed flipped/discontinuous rotations for
spinning objects like wheels and propellers.

Pull Request: https://projects.blender.org/blender/blender/pulls/142026
2025-07-17 19:44:46 +02:00
Mattias Fredriksson
50ec3cb2d4 Cleanup: Mutable Span in geom compare
Data is only accessed but variable is of type MutableSpan unlike `sorted_to_values1`.

Pull Request: https://projects.blender.org/blender/blender/pulls/142224
2025-07-17 16:59:56 +02:00
Miguel Pozo
11e423f7ef Fix #141918: Crash when playing 2 image sequences
Fix the race condition.

Pull Request: https://projects.blender.org/blender/blender/pulls/141960
2025-07-17 16:35:05 +02:00
Falk David
7d15b346d1 Cleanup: Remove GPENCIL_ANY_VERTEX_MASK macro
This replaces the `GPENCIL_ANY_VERTEX_MASK` legacy macro
with a function that is used in the Grease Pencil code.

Also removes some includes of legacy headers.
2025-07-17 16:19:03 +02:00
Falk David
c5642fc3c6 Cleanup: Remove unused legacy marco definitions
These macros were originally used by GPv2 before 4.3.
Now they are completly unused.
2025-07-17 16:19:03 +02:00
Hans Goudey
622e3d4792 Fix: Potential issue with multires bake tangent handling
Mistake in b19696c0b8

Don't reference the data from the `Array` which will just be the inline
buffer if `require_tangent` is false (for displacement baking).

I still observe a crash when multires baking, but that's deep in Cycles
code.
2025-07-17 10:08:43 -04:00
YimingWu
aa6761f65f Fix #142183: Grease Pencil: Check object type upon exporting selected frames
When only exporting "Selected Frames", we need to read frames from the
active grease pencil object. If the active object isn't a grease pencil
object, we need to return early and do not export.

Co-authored-by: Thomas Dinges <thomasdinges@noreply.localhost>
Pull Request: https://projects.blender.org/blender/blender/pulls/142188
2025-07-17 15:56:36 +02:00