Commit Graph

151646 Commits

Author SHA1 Message Date
Harley Acheson
7580da6bd2 UI: Removal of Win32 Platform-Specific Cursor Files
We are now able to make antialiased mouse cursors at any size directly
from SVG sources. Therefore there is no need for the platform-specific
"cur" versions of these cursors. This removes the work required in
duplicating the cursors in this format. Otherwise the results should be
identical.

Pull Request: https://projects.blender.org/blender/blender/pulls/141309
2025-07-05 00:39:50 +02:00
Julian Eisel
183420bd07 Refactor: Make file-list cache struct non-trivial C++ one
Makes it possible to use non-trivial C++ types in `FileListEntryCache`.
I'm planning to use this for blender/blender!130543, to store status
information about downloaded previews. While it's possible to use
C-style types instead, this is easier and a worthwhile general
improvement.

I turned `FileList.filelist_cache` into an allocated pointer, so
`FileList` doesn't have to be ported to be a non-trivial type as well.
We probably want to do that too at some point.

Pull Request: https://projects.blender.org/blender/blender/pulls/141411
2025-07-04 23:09:02 +02:00
Germano Cavalcante
58af30f9b9 Refactor: Transform: Unify logic of "orient_axis" and "constraint_axis"
In rotation-based transform operations, the rotation axis can be
determined in two ways:
1. Through "orient_axis" (X, Y or Z)
2. Through "constraint_axis"

When the axis is obtained through the constraint, "orient_axis" is
ignored, and the angle may be negated depending on the view orientation
to match the mouse movement.

However, "orient_axis" never has its angle negated. Since the default
orientation is "View", the Z axis is inverted by default, aligning with
the mouse movement but not with the constraint axis.

This causes problems in the Redo Panel because the constraint fields
are hidden in the Rotation operation, so they need to be unset for the
Axis field to work. However, if you change the value of the Rotation
field, the object may have its rotation negated unexpectedly.

This issue was partially shown in #93078. Commit c30e6a37b0 attempted
to fix it by unsetting the constraint property when the Axis was
changed. However, this solution is incomplete: if the Axis is changed
and then reverted, the negative rotation issue reappears. In addition,
it has not been implemented in all operations.

This commit resolves the issue by reverting c30e6a37b0, aligning the
behavior of "orient_axis" and "constraint_axis", and unsetting
"constraint_axis" in `saveTranform`.

A downside of this solution is that it may break operators invoked from
Python that rely on "orient_axis" as the rotation axis, as the rotation
value now needs to be negated.

Pull Request: https://projects.blender.org/blender/blender/pulls/141101
2025-07-04 20:47:25 +02:00
Namit Bhutani
e5db240434 Mesh: Spatial Reordering for Sculpt Speed Improvements
**Problem Description**

Blender's current mesh data layout often lacks spatial coherence,
causing performance bottlenecks during BVH construction for sculpting
and painting operations. Each time a BVH is built, the system must
recompute spatial partitioning and vertex groupings from scratch,
leading to redundant calculations and suboptimal memory access patterns.

**Proposed Solution**

This patch implements pre-computed spatial organization of mesh data
through a new `mesh_apply_spatial_organization()` function that:

- Reorders vertices and faces based on spatial locality using recursive
  spatial partitioning.
- Stores pre-computed MeshGroup hierarchies in MeshRuntime for reuse.
- Enables the BVH system to bypass expensive spatial computation when
  pre-organized data is available.

This approach separates the expensive spatial computation from more
frequent BVH rebuilds, providing sustained performance improvements
across multiple sculpting operations.

**Limitations**

- Requires manual invocation (occurs automatically only during remesh
  operations).
- Additional memory overhead for storing MeshGroup metadata.
- One-time computational cost during initial organization.
- Spatial group references are not yet stored in files.

**User Interface**

The feature is accessible via a new "Reorder Mesh Spatially" operator in
the Mesh Data Properties panel under the Geometry Data section. Users
can invoke it manually when needed, or it will be applied automatically
during quadriflow and voxel remesh operations. The operator provides
feedback confirming successful spatial reordering.

Pull Request: https://projects.blender.org/blender/blender/pulls/139536
2025-07-04 20:02:37 +02:00
Harley Acheson
a60ec16858 Fix #141225: Hide Right Node Editor Scrollbars When Sidebar Visible
For Node Editors do not show right-side scrollbars if region overlap
and there is a right-aligned region open, to avoid two scrollbars.

Pull Request: https://projects.blender.org/blender/blender/pulls/141418
2025-07-04 19:50:44 +02:00
Germano Cavalcante
79721249b0 Cleanup: Avoid unnecessary indentation levels in 'tranform.cc'
Use early return and remove repeated conditions.
2025-07-04 14:47:11 -03:00
Hans Goudey
123267933c Fix #141430: Crash with viewer node on invalid domain
Since 68759af516, it was possible
to add attributes on invalid domains. Just add a check for that.

Pull Request: https://projects.blender.org/blender/blender/pulls/141460
2025-07-04 18:57:33 +02:00
Guillermo Venegas
3cd285d7f0 Cleanup: UI: Remove unused pie menu functions
I couldn't find exactly when it was stopped being used,
but seems that this has some years with no use.

Pull Request: https://projects.blender.org/blender/blender/pulls/141435
2025-07-04 18:29:05 +02:00
Falk David
cc7f1a2b52 Merge branch 'blender-v4.5-release' 2025-07-04 18:05:43 +02:00
Falk David
eff92923ec Fix: Grease Pencil: Soft eraser leaves points with zero opacity
The soft eraser could leave points with zero opacity. To fix this issue
for now, we apply a post-process step when the stroke is done to remove
these points.

In the future, it would be better to refactor the eraser a bit more and
delete points during the stroke.

Part of #131686.

Pull Request: https://projects.blender.org/blender/blender/pulls/141454
2025-07-04 17:22:49 +02:00
Dalai Felinto
2c9d14f9c4 Merge remote-tracking branch 'origin/blender-v4.5-release' 2025-07-04 16:08:45 +02:00
Dalai Felinto
7d3b93ed4e Multi-View: Fix (unreported) wrong icons for disabled Render Views
This is likely broken since 60cc73afe6, when I sorted the icons
alphabetically.

Multi-View lives on!
2025-07-04 16:05:49 +02:00
Pratik Borhade
a559fb833c Tree View: Multi-select support
Add support to select multiple tree view elements (similar to outliner/anim channels)
`Ctrl + LMB` to select+activate element under the mouse
`Shift + LMB` to select all items between active and clicked item.

As of now, only Shape key has support for multi-select. (straightforward to include
other views). `KEYBLOCK_SEL` flag is used for storing selection state.

Pull Request: https://projects.blender.org/blender/blender/pulls/138979
2025-07-04 15:45:18 +02:00
Ido-Shahar
0e8110fa94 Node Wrangler: Add support for boolean sockets to nw_merge_nodes, results in a Boolean Math node
### Summary

A small fix / addition to Node Wrangler operators.py, specifically the
nw_merge_node operation. I added support for merging nodes with
boolean sockets, which used to not respond to nw_merge_nodes / nw_lazy_mix.

### Motivation

As a user, I found it frustrating that I couldn't use lazy mix on boolean
nodes, as geonodes-heavy projects relied on them, and required adding
Boolean Math nodes often.
I intuitively expected it to add a Boolean Math node, which is the most
similar to Math Add for floats & Join Geometry for geometry.

### Implementation

A boolean nodes list is created when the rest of the lists are cerated,
nodes with boolean outputs get added to it, it's taken into consideration
when checking if PASS_THROUGH, then if we didn't PASS_THROUGH,
a Boolean Math node is created, similar to the existing options.
When the user uses a math merge shortcut (ctrl+0, ctrl+*, etc), the
code ignores it, adds Boolean Math anyway.

Pull Request: https://projects.blender.org/blender/blender/pulls/140236
2025-07-04 15:26:21 +02:00
Ray Molenkamp
81e862140f Deps_builder: pydantic 2.11.7
As requested by @dr.sybren and approved by the admins

Also pydantics deps :

annotated-types 0.7.0
pydantic-core 2.33.2
typing-extensions 4.14.0
typing-inspection 0.4.1

these are installed as binary packages agreed upon with the admins

versions determined by just pip installing it and seeing what it dragged in.

as some of these are binary packages that will differ per platform, there will
be a per platform hash for some packages now unfortunately

Pull Request: https://projects.blender.org/blender/blender/pulls/140434
2025-07-04 15:25:17 +02:00
Philipp Oeser
458e224587 Merge branch 'blender-v4.5-release' 2025-07-04 15:01:33 +02:00
Philipp Oeser
eb82ff6166 Fix #141387: Light Probes not integrated into Animation Editors
You could basically not interact with the animation (except for
keyframes in the main region), channels region was totally empty, NLA
could not be used, ...

It is not something users will animate a lot, but we should still have
animation editors in mind when adding a new object type.

Just missing from cc31d7bb49

Pull Request: https://projects.blender.org/blender/blender/pulls/141449
2025-07-04 15:01:15 +02:00
Falk David
93d83bdad4 Merge branch 'blender-v4.5-release' 2025-07-04 14:57:53 +02:00
Falk David
859d271528 Fix: Grease Pencil: Crash when geometry has no drawings
Adds checks to the `get_drawing` functions to make sure that there is at
least one drawing in the geometry.
2025-07-04 14:57:08 +02:00
Alaska
7771c36270 Tests: Add tests for AOV passes on objects with transparent materials
This commit adds a test for the situation in which a AOV pass is used
on a object with a fully or semi-transparent material, either using the
transparent BSDF directly, or mixing it with some other material.

Pull Request: https://projects.blender.org/blender/blender/pulls/141068
2025-07-04 14:29:11 +02:00
Omar Emara
c18e4b69a4 Fix: Versioning of Normal node applies to all nodes
The versioning code for the Normal node applies to all nodes, while it
should only apply to the Normal node.

Pull Request: https://projects.blender.org/blender/blender/pulls/141452
2025-07-04 14:07:00 +02:00
Campbell Barton
441cc3ab09 Merge branch 'blender-v4.5-release' 2025-07-04 20:23:30 +10:00
Jason C. Wenger
014be23586 Fix #141351: Default edge dissolve angle leaves many verts undissolved
Adjust angle threshold defaults to dissolve verts as before,
while preserving selected geometry.

The new behavior works as follows:

- If a dissolve terminates on an edge loop or the the corner vert of a
  face, do the dissolve.
- If a set of dissolve edges (either a chain, or a set of 3+ edges)
  crosses a loop cut, do the dissolve.
- If a chain of dissolve edges touch the corner of an unselected face,
  and then leave in a different direction without crossing a loop cut,
  preserve that vert. Just because the selection touches it doesn't mean
  it should be altered.
- If a dissolve edge is separating two triangles,
  then the face join creates a quad. Users generally prefer
  and strive to create meshes that contain quads.
  Instead of destructively dissolving the corners of the quad and
  automatically turning it to a triangle or wire,
  instead prefer to preserve the quad.

Ref !141097
2025-07-04 20:14:55 +10:00
Pratik Borhade
eab747e8dd Fix #51739: Sliding values in add primitive redo panel not hiding cursor
Cursor is actually wrapped at the beginning with the help of function
`WM_cursor_grab_enable`. Though the `ND_MODE` event notifier added
inside  `editmode_enter/exit_ex` further calls `region_cusor_set()`.
This resets the cursor to default at the bottom of
`ED_region_cursor_set()`. Such sitution could be avoided by creating a
dummy cursor function for hud region. But issue remains when we call
redo panel from F9. As Julian suggested, add condition for `grabcursor`
to avoid changing cursor when editing buttons.

Pull Request: https://projects.blender.org/blender/blender/pulls/133529
2025-07-04 12:01:03 +02:00
Pratik Borhade
841c36850c Fix #67806: Delete non existing temp screens
When deleting a window, clear screen ID data if it belongs to
non-main window with single area

Pull Request: https://projects.blender.org/blender/blender/pulls/132978
2025-07-04 11:56:12 +02:00
Campbell Barton
dcf59ca85a Merge branch 'blender-v4.5-release' 2025-07-04 19:54:38 +10:00
Campbell Barton
389a9197ae Merge branch 'blender-v4.5-release' 2025-07-04 19:51:40 +10:00
Patryk-Skowronski
c53a0cfcb6 NDOF: use fixed speed values for translations in "Fly Mode"
Use fixed speed values for translations in Fly mode to constant
values for each axis. Until now, after switching to the Fly mode,
the latest speed value calculated based on RegionView3D::dist
was used for translations.
Now, the translation speed in Fly mode is an adjusted constant
for each axis.

Ref !141285
2025-07-04 19:33:43 +10:00
Casey Bianco-Davis
5cbaee3321 Grease Pencil: Implement align Bézier handles in transform operator
This PR add bezier `align` type calculation to Grease Pencil.
Curves objects were implement in #128726.

Pull Request: https://projects.blender.org/blender/blender/pulls/141371
2025-07-04 11:27:14 +02:00
Pratik Borhade
29b97535d7 Cleanup: Use one struct member for GP and curve point count
Remove totgppoint/totcuvepoints and instead use `totpoints`.

Pull Request: https://projects.blender.org/blender/blender/pulls/141441
2025-07-04 10:58:03 +02:00
Pratik Borhade
70f4eccdfc Cleanup: Remove unused header
Functions from these headers are not used anywhere in `info_stats.cc`

Pull Request: https://projects.blender.org/blender/blender/pulls/141444
2025-07-04 10:56:56 +02:00
Falk David
c2225155e2 Cleanup: Remove meaningless consts in function declaration 2025-07-04 10:51:56 +02:00
Pratik Borhade
27b205f579 Fix #141420: Grease Pencil: Crash enabling material overlay without material
Crashed due to accessing members of nullptr Material. Add extra
condition to avoid this.

Pull Request: https://projects.blender.org/blender/blender/pulls/141431
2025-07-04 10:40:09 +02:00
Aras Pranckevicius
65ce05eae7 Merge branch 'blender-v4.5-release' 2025-07-04 11:37:22 +03:00
Aras Pranckevicius
641824753a Fix #141434: OBJ importer should apply bounds clamp size to the whole scene
It was applying the bounds clamp to each object individually,
which changed spatial relationships between objects. Make the logic
match what used to be done in the Python OBJ importer back in the day.

Pull Request: https://projects.blender.org/blender/blender/pulls/141446
2025-07-04 10:36:18 +02:00
Lukas Tönne
455a8554e2 Refactor: Utility "mixer" class to simplify armature deform functions
The main armature deform functions compute a vector and/or matrix from
a weighted sum of bone deformations. This can be done either with
linear interpolation or using dual quaternions.

The linear and dual-quaternion methods were mixed together in the same
functions, which makes the code unnecessarily hard to follow. This patch
introduces a "Mixer" concept (similar to attribute math) that abstracts
the process of adding bone influence to the target vector/matrix. It also
takes care of finalizing the value. This way the code iterating over the
vertex group and/or bone envelopes can be agnostic of the target data.

The ArmatureUserData also receives significant refactoring to remove
unnecessary variables, utilize modern math classes, and generally improve
variable naming.

Pull Request: https://projects.blender.org/blender/blender/pulls/141348
2025-07-04 10:13:48 +02:00
Philipp Oeser
ae0ca8e616 Merge branch 'blender-v4.5-release' 2025-07-04 10:11:52 +02:00
Philipp Oeser
ab9f03555c Fix #141384: Anim Channel Pinning: object data pin only for cameras
As mentioned in 98c7e75897, the idea of "pinning" was to have certain
animation always visible (regardless of object selection -- e.g.
animating camera movement even while animating something else).

dea7ef4dd9 added a special case that would also
include the object regardless of it being selected or not if its
**object data** is animated and pinned.

It only fully implemented that for Cameras though (that was the primary
request at that time), leaving ugly blank/empty space (pin icon missing)
for other object data types.

It is understandable that it only did it for Cameras a that time, but
there is no reason to **not** do it for other (viewport selectable)
object data types as well (animators might as well be interested in
pinning other types as well for timing reference) -- which is what this
PR does.

Adding this to 4.5 (since it fixes the blank space (even though it is
somewhat adding a feature as well...)

Pull Request: https://projects.blender.org/blender/blender/pulls/141396
2025-07-04 10:11:34 +02:00
Philipp Oeser
9f3d47a5d8 Merge branch 'blender-v4.5-release' 2025-07-04 10:09:55 +02:00
Philipp Oeser
5787b74580 Fix #141378: Anim Channel Pinning on object data lost adding object anim
Seems like a mistake in dea7ef4dd9

The decision to display an object or not in animation filtering is done
in `animdata_filter_base_is_ok`
So e.g. if an **object** has `AnimData` and that one is pinned
(`ADT_CURVES_ALWAYS_VISIBLE`) it would be included regardless of it
being selected or not. dea7ef4dd9 added a special case that would also
include the object regardless of it being selected or not if its
**object data** is animated and pinned.

What dea7ef4dd9 did wrong though in that special case was that it also
required the object to **not** have animation.
This seems wrong, the object can have animation which itself is not
pinned (ultimately causing `animdata_filter_base_is_ok` to return
`false`).

So to resolve, remove the check for NULL object animation, it should be
entirely enough to have object data animation which is pinned to include the
object in animation filtering.

Pull Request: https://projects.blender.org/blender/blender/pulls/141379
2025-07-04 10:09:34 +02:00
Guillermo Venegas
eb3c6c0505 Fix: Collection name is clamped to 64 characters on creation
Noticed while adding the `Move to Collection` menu #140883.
This follows #137608

Pull Request: https://projects.blender.org/blender/blender/pulls/141350
2025-07-04 05:33:07 +02:00
Campbell Barton
a950d0b2b1 Build: correct error in 2a414eea0c 2025-07-04 13:20:39 +10:00
Eitan Traurig
be72a484e5 UI: Disable Copy and Remove Materials when slots are empty
Grey out this operator when material list is empty

Pull Request: https://projects.blender.org/blender/blender/pulls/141283
2025-07-04 04:55:05 +02:00
Maxime-Cots
6e3039173d UV: Ensure Pie Menu consistency with 3D Viewport
"Selected to Grid" and "Cursor to Grid" are now swapped to fix the
consistency between UV Snap Pie Menu and 3DView Snap Menu.

Resolves #140714

Co-authored-by: Nig3l <nig3lpro@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/141300
2025-07-04 04:33:02 +02:00
Campbell Barton
2a414eea0c PyAPI: Refactor attribute access to avoid creating & clearing exceptions
- Add PyObject_GetOptionalAttrString (only available in Python 3.13).
- When registering RNA classes use optional attribute access to avoid
  raising and clearing exceptions.
- Refactor macro that handles substituting Python's built-ins
  with a `for` loop for better readability.
2025-07-04 12:09:16 +10:00
Campbell Barton
dad8bddd78 Cleanup: remove redundant calls to PyErr_Clear after PyErr_Print
I was under the impression both were needed however
PyErr_Print always clears the error too.
2025-07-04 11:10:54 +10:00
Campbell Barton
b99e4e1de1 PyAPI: treat "None" fallback properties as missing in class registration
If `__name__` or `__doc__` were None, the property would be detected as
being set when checking if the property is set (for required properties).

This is more of a technical correction as its unlikely developers would
run into this in practice since `__name__` should never be None and
the description is not a required property.
2025-07-04 11:02:24 +10:00
Campbell Barton
c2c8f54a52 Merge branch 'blender-v4.5-release' 2025-07-04 09:19:25 +10:00
Jorn Visser
94f4df8ec4 Fix #141339: Mantaflow: Clear Python errors when grids aren't available
Adding a Flow to a Mantaflow domain could sometimes cause a crash. This
was because the grids are allocated lazily, and as such, getting them
through `PyObject_GetAttrString` will fail when they are not yet
available. As the resulting Python errors were not cleared, Python could
be left in a bad state, leading to crashes. This is avoided by clearing
these errors before returning from `callPythonFunction` when such an
error is raised.

Ref !141364
2025-07-03 23:17:25 +00:00
Sean Kim
34ce46322c Refactor: Change SubdivCCG adjacency structs to use containers
This commit changes the `SubdivCCGAdjacentEdge` and
`SubdivCCGAdjacentVertex` structs to be simple wrappers around standard
container types, avoiding the need for manual memory management.

Pull Request: https://projects.blender.org/blender/blender/pulls/141163
2025-07-03 23:03:57 +02:00