Commit Graph

152145 Commits

Author SHA1 Message Date
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
YimingWu
37df7ea850 Fix #137429: GPU: Allow missing attribute in pygpu_shader_attrs_info_get
In `pygpu_shader_attrs_info_get`, it tries to check information for all
vertex attributes that are added via `VERTEX_IN`, however some drivers
will optimize compiled shaders so some vertex attributes that are not
used will be removed. This fix makes sure that the input length that
is used in `GPU_shader_get_attribute_len` does not exceed actual max
binding number.

Pull Request: https://projects.blender.org/blender/blender/pulls/137584
2025-07-17 15:54:12 +02:00
Piotr Makal
6697dc2561 Fix: Crash when Bevel operation is performed on border edges
Fix #142045 crash on performing bevel operation on border edges.
When user selected both border edges and neigboring edges
(parallel to those border egdes) for the bevel operation,
the former were omitted during construction of BevVert objects
but their initial UV connectivity were recorded during call
to determine_uv_vert_connectivity function - specifically BMLoop
pointers were stored in BevelParams::uv_vert_maps member.
This later caused issues after rebuilding existing polygons
(bevel_rebuild_existing_polygons) since previously recorded
BMLoop pointers became invalid for border edges but still were
stored in uv_vert_maps (uv_vert_map_pop function was not called
for them since those loops were not related to BevVert objects).
This caused crash when accessing UV positions, when providing
invalid loop pointer to BM_ELEM_CD_GET_FLOAT_P function in bevel_merge_uvs.
2025-07-17 09:20:34 -04:00
Philipp Oeser
2fd36b0ab7 Fix #142103: Animation decorator not working on Light Temperature value
When having a checkbox and a value both in one row together with an
animation decorator it is questionable whether the decorator should act
on animating the checkbox or the corresponding value.

We had similar cases before (e.g. 7c04ef210e)

In this case as well, one would think it is more desirable to animate
the actual Temperature **value** (instead of the checkbox), so this is
what this PR does.

Pull Request: https://projects.blender.org/blender/blender/pulls/142192
2025-07-17 15:03:50 +02:00
Christoph Lendenfeld
d64ace7799 Fix #142106: FCurve noise modifier versioning error
This issue occurred because versioning was applied twice.

The history:
* First I created 05aac73b45 which fixed the issue on main (4.5 at the time), version `405, 14`
* Then I created a backport for 4.4.3 f1e829a459 which also added versioning, version `404, 32`

That means all files created with 4.4.3 (`404, 32`) already had versioning
applied. However then opening it in 4.5 applied the versioning again since that only checked
if the version was at least `405, 14`

The fix is to exclude files that have already been saved with `404, 32`

Pull Request: https://projects.blender.org/blender/blender/pulls/142208
2025-07-17 14:22:16 +02:00
Philipp Oeser
8f605baa2e Fix #142062: Armature EditBone RNA paths incomplete
`PoseBone` and `Bone` already have their `struct_path_func` defined, but
that was missing from `EditBone`.
Since `EditBone` is usually what is visible from the UI (and only later
gets flushed to `Bone` via `ED_armature_from_edit`), it makes sense to
have complete RNA paths for `EditBone` as well.

Enables the usual context menu `Copy Data Path`, `Copy As New Driver`,
... automatically.

Pull Request: https://projects.blender.org/blender/blender/pulls/142065
2025-07-17 14:02:22 +02:00
Jacques Lucke
f2ee95843c Nodes: improve socket tooltips
The main goal of the patch is to make the socket tooltips more useful. This is
achieved in two ways:
* Use better text formatting in the tooltip to make it easier to parse and to
  better separate the current actual value from more general information about
  the socket.
* Add some more information like implicit field inputs when the node is not used
  currently or more details about a color.

This patch basically rewrites the entire tooltip generation, because it's quite
different from before (where we just created a single string for the entire
tooltip).

I'm using monospace for the actual current socket value and type, while the
normal font is used for general information about the socket like it's name,
description, allowed geometry types etc.

Pull Request: https://projects.blender.org/blender/blender/pulls/140540
2025-07-17 12:48:17 +02:00
Lukas Tönne
7495d5222b Fix: Grease Pencil interpolation on cyclic curves shifts end point
Fix for unreported issue with Grease Pencil interpolation tool: on cyclic curves
the last point is interpolated between the end points of the curve, especially
noticeable with sequence interpolation.

This required handling a corner case in the curve sample mapping function.
This function is complex and hard to verify with the operator alone, leading to
frequent issues and discovery of yet more corner cases. For this reason i
refactored the sampling function and added new unit tests.
This should help avoid regressions and make it clear how the function is
expected to behave in various corner cases.

The `sample_curve_padded` function has been moved into the geometry module,
since the `sculpt_paint` module does not have tests yet and is intended mostly
for higher-level operator code. The function has been split to separate out the
"reverse" sampling mode, which reduces complexity. Reverse sampling is done by
first reversing the input curve points, doing regular sampling, and then
reversing the resulting samples.

The function can now sample to larger or smaller sample arrays:
- Larger output arrays have a point aligned with each source point as before,
  with the rest of the points evenly distributed over the source curve.
  This ensures that the output curve matches the source as closely as possible,
  especially for poly curves.
- Smaller output arrays are uniformly sampled along the length of the source
  curve.

Pull Request: https://projects.blender.org/blender/blender/pulls/141946
2025-07-17 12:05:23 +02:00
Christoph Lendenfeld
e80ceb52df Fix #139509: Slot assignment is lost when loading file saved in tweak mode
The issue was that the `AnimData.tmp_slot_handle` had no RNA property associated with it
and so it couldn't be saved in the lib override.

The fix is to add the property. To ensure the correct code is called, most of the previous code
was replaced with a call to `blender::animrig::assign_tmpaction`

Pull Request: https://projects.blender.org/blender/blender/pulls/141395
2025-07-17 11:35:18 +02:00
Sebastian Parborg
c19218e423 Fix #141943: Correctly detect manifold libs when not in strict mode 2025-07-17 11:33:43 +02:00
Falk David
1a46806546 Fix: Grease Pencil: Missing call to finish() writing layer attributes
The `GSpanAttributeWriter` was missing a call to `finish()` to ensure
the changes are tagged and saved.
2025-07-17 11:31:10 +02:00
Christoph Lendenfeld
0191848671 Fix #141909: Creating a pose assets captures unkeyed custom properties
This was an oversight caused by 358a0479e8

Before this, only keyed custom properties were capture into the pose asset.
This behavior is now restored.

Pull Request: https://projects.blender.org/blender/blender/pulls/141937
2025-07-17 11:05:31 +02:00
Lukas Tönne
23d02ec57b Fix armature deform: Avoid accessing parameter data after moving 2025-07-17 09:42:39 +02:00
Jacques Lucke
55e2fd2929 Cleanup: unify naming for named constructors
Previously, we used an inconsistent naming scheme for such "named constructors".
Now it always uses `from_*`.

Pull Request: https://projects.blender.org/blender/blender/pulls/142175
2025-07-17 09:09:16 +02:00
Jacques Lucke
cbb76f21a1 Geometry Nodes: forbid some special characters in bundle item names
The goal is to be able to form bundle value paths like `Group/Sub/Geometry` in
the future. Additionally we might want to be able to use these paths in some
kind of expression for selecting a set of bundle paths. This requires us to
constrain what characters are allowed to be used in bundle paths. This patch
forbids using various special characters. Since we don't know exactly which
characters we'll need exactly in the future, I added more characters to the
forbidden-list than likely necessary. It's easier to make them available later
on than to try to forbid them later.

The forbidden chars are the following currently:
`/*&|"^~!,{}()+$#@[];:?<>.-%\=`.
Those are automatically replaced by an underscore if used.

Pull Request: https://projects.blender.org/blender/blender/pulls/142168
2025-07-17 08:00:15 +02:00
Campbell Barton
eee549f882 Docs: add readme for extensions
This intends to give an overview of the extensions implementation.

Co-authored-by: Sybren A. Stüvel <sybren@blender.org>

Ref !134785
2025-07-17 03:20:16 +00:00
Campbell Barton
989af38c93 Docs: add some code-comments regarding the default exclusions 2025-07-17 13:11:43 +10:00
Nika Kutsniashvili
169dbdd60f Extensions: exclude backup blend files when building an extension
Ref !142091
2025-07-17 13:11:29 +10:00
Campbell Barton
e8e188cb7d Cleanup: various non-functional changes for C++ 2025-07-17 12:32:30 +10:00