Commit Graph

150391 Commits

Author SHA1 Message Date
Guillermo Venegas
25873ccf53 Refactor: UI: Replace uiLayoutSetEmboss and uiLayoutGetEmboss with uiLayout methods
This converts `uiLayoutSetEmboss` and `uiLayoutGetEmboss` function APIs
to objects methods following recent `uiLayout` refactors.
Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/139811
2025-06-05 06:00:02 +02:00
Harley Acheson
8daea1d0b2 Merge branch 'blender-v4.5-release' 2025-06-04 18:34:46 -07:00
Harley Acheson
ccb0dc50fb Fix #139780: Always Enforce Minimum Area Heights on File Load
We attempt to enforce a minimum area height so that they cannot be made
smaller than header height. This works correctly as we drag resize
areas but not when loading blend files. We skip doing so if resizing
from smaller to a bigger vertical size. This PR just makes it so we
enforce minimum size always.

Pull Request: https://projects.blender.org/blender/blender/pulls/139804
2025-06-05 03:31:56 +02:00
Sean Kim
582c7d94b8 Paint: Scale brush size in preparation for planned 5.0 changes
This commit, in conjunction with !139561, is used to ensure consistent
values for the brush size while we transition it from representing
radius to diameter.

Related to #134204

Pull Request: https://projects.blender.org/blender/blender/pulls/139813
2025-06-05 00:46:10 +02:00
Sean Kim
2bbc9e73fc Merge branch 'blender-v4.5-release' 2025-06-04 15:45:32 -07:00
Sean Kim
6a03e8249d Paint: Add forward compatibility code for brush size
In 5.0, we plan to change the brush size from representing radius to
diameter. This means that for 5.0 files loaded in 4.5, we need to
scale the stored value when reading the relevant brush fields.

Related to #134204

Pull Request: https://projects.blender.org/blender/blender/pulls/139561
2025-06-05 00:44:43 +02:00
Sean Kim
653601a416 Merge branch 'blender-v4.5-release' 2025-06-04 15:02:57 -07:00
Sean Kim
e906fe2738 Fix: UV Editor doesn't show UVs in non-edit modes
Introduced in 440c6c8b6f

Pull Request: https://projects.blender.org/blender/blender/pulls/139857
2025-06-05 00:02:03 +02:00
Hans Goudey
99736cc6ca Merge branch 'blender-v4.5-release' 2025-06-04 15:47:10 -04:00
Hans Goudey
c9bb7f0b23 Fix: Texture paint color jitter dereference of uninitialized optional
The value isn't created unless jitter is enabled, but it was always
retrieved for a function argument. The uninitialized memory wasn't read,
but it caused a crash in debug builds.

Pull Request: https://projects.blender.org/blender/blender/pulls/139854
2025-06-04 21:27:16 +02:00
Hans Goudey
178f1d6fc5 Merge branch 'blender-v4.5-release' 2025-06-04 14:44:22 -04:00
Laurynas Duburas
46bc894570 Fix: Curves: Custom knots in Curves and GP operators
Current strategy to deal with operators not supporting custom NURBS
knots is to fall back to calculated knots for curves of the custom mode
but with no `CurvesGeometry::custom_knots` allocated. Such curves are
the result of operators that copy only `Point` and `Curve` domains. This
way the problem is only postponed. It is not possible to add new custom
knot curves to such `CurvesGeometry` as custom knot offsets are
calculated all together and there is no way to distinguish between old
curves with lost knots and new ones. This is more a future problem.

The actual problem in `main` can be shown with an attached blend file
(see PR) by applying `Subdivide` to some points and then adding new
`Bezier` curve to the same object. This particular problem could be
addressed somewhere in `realize_instances.cc` but the actual problem
would persist.

This PR handles custom knots in all places where `BKE_defgroup_copy_list`
is iused, and where `bke::curves::copy_only_curve_domain` is called.
Here the assumption is made that only these places can copy custom knots
modes without copying custom knots. Depending on operator logic knots are
handled most often in one of two ways:
 - `bke::curves::nurbs::copy_custom_knots`:
   copies custom knots for all curves excluding `selection`. Knot modes
   for excluded curves are altered from the custom mode to calculated.
   This way only curves modified by the operator will loose custom knots.
 - `bke::curves::nurbs::update_custom_knot_modes;`
   alters all curves to calculated mode.

In some places (e.g. `reorder.cc`) it is possible to deal with knots
without side effects.

PR also adds `BLI_assert` in `load_curve_knots` function to check if
`CurvesGeometry::custom_knots` exists for custom mode curves. Thus
versioning code is needed addressing the issue in files in case such
already exists.
Pull Request: https://projects.blender.org/blender/blender/pulls/139554
2025-06-04 20:43:15 +02:00
Hans Goudey
d7ae9cbfeb Cleanup: Sculpt: Remove unused argument
Missing from baa2ae6a59
2025-06-04 13:47:18 -04:00
Brecht Van Lommel
c2a2d1af1b Merge branch 'blender-v4.5-release' 2025-06-04 19:25:20 +02:00
Brecht Van Lommel
2167a65e11 Fix: OSL camera templates should not have copyright and license header
For consistency with other templates, these can be used in new code without
restrictions.
2025-06-04 19:24:52 +02:00
Brecht Van Lommel
0add3f31a2 Cycles: Bump OptiX minimum and release version to 8.0.0
This requires a minimum driver version of 535, however most devices
were already requiring 570 due to the CUDA toolkit version.

The update is required to be able to use an API function for correct
stack size calculation.

Code for older API versions has been removed.

Fix #138185: OSL custom camera errors with OptiX

Pull Request: https://projects.blender.org/blender/blender/pulls/139801
2025-06-04 19:24:21 +02:00
Bastien Montagne
ec64e9cb86 Merge branch 'blender-v4.5-release' 2025-06-04 18:20:20 +02:00
Bastien Montagne
3a47bd7e5a Fix #139810: Missing git lfs checkout in make update.
When binary files managed by git-lfs are not hosted by the main source
repo (e.g. when using the github mirror), the fall-back repo set up by
`lfs_fallback_setup` does fetch the files, but the follow-up call to
`git pull` in `work_tree_update` does not check them out.

This commit simply adds an extra `git lfs checkout` command there.

Pull Request: https://projects.blender.org/blender/blender/pulls/139825
2025-06-04 18:19:25 +02:00
Sean Kim
baa2ae6a59 Sculpt: Remove dyntopo BMesh reordering
In certain cases, when a Mesh is generated from a BMesh as part of
Dyntopo sculpting, (e.g. when the data is invalidated when leaving
Dyntopo or Sculpt mode) the face and vert indices are compressed to
remove any gaps that may exist due to deletion of elements. This step is
redundant to perform prior to converting to a Mesh, as the process of
doing so already compresses the indices

To avoid doing extra work, this commit simply removes this conversion
and any associated helper methods.

Pull Request: https://projects.blender.org/blender/blender/pulls/139313
2025-06-04 18:19:08 +02:00
Hans Goudey
4ccf435058 Brush: Remove legacy icon replaced by asset preview image
This icon was useful before the brush assets change. Nowadays
the workflow is different, and users have had time to use the
asset preview instead.

Resolves #121365.

Pull Request: https://projects.blender.org/blender/blender/pulls/139844
2025-06-04 18:16:30 +02:00
Hans Goudey
a3bd1bbbf4 Merge branch 'blender-v4.5-release' 2025-06-04 11:49:51 -04:00
Hans Goudey
e346c6d7a0 Fix #139816: Corrupt wireframe with antialiasing off and subdivision
Caused by 1e1ac2bb9b.

Previous removal of < 4 byte aligned GPU vertex buffer formats was
incomplete. The edge factor buffer still used a single-byte format.

Pull Request: https://projects.blender.org/blender/blender/pulls/139839
2025-06-04 17:47:13 +02:00
Hans Goudey
84bee96757 Mesh: 5.0 changes for mask, custom normals, UV seam
Complete the versioning and writing changes from these commits:
- f9b627d29c
- f2bcd73bd2
- c5ba8bd7c2

4.5 has the forward compatibility handling to support reading files
written by 5.0. This removes the conversion when writing files
and removes the lookup of ".uv_seam" as a fallback for "uv_seam".

Pull Request: https://projects.blender.org/blender/blender/pulls/139841
2025-06-04 17:46:48 +02:00
Hans Goudey
1ee43f7b2b Cleanup: Remove meaningless const for return by value 2025-06-04 11:00:47 -04:00
Thomas Dinges
86e30a29f1 Versioning: Add 500 versioning file
Pull Request: https://projects.blender.org/blender/blender/pulls/139830
2025-06-04 16:31:45 +02:00
Brecht Van Lommel
e79fcb4f56 Merge branch 'blender-v4.5-release' 2025-06-04 16:14:05 +02:00
Brecht Van Lommel
2c948b873e Build: Make libraries compile on Linux ARM64 again
NASM is an x86 assembler, doesn't work on ARM.
2025-06-04 16:10:37 +02:00
Hans Goudey
d9c7118983 Refactor: Move collection runtime struct out of DNA
Like other runtime structs, allocate it separately from the base
DNA struct. The main benefit is allowing the use of C++ features
for runtime data.

Pull Request: https://projects.blender.org/blender/blender/pulls/138605
2025-06-04 15:47:43 +02:00
Bastien Montagne
c34bbb7b2c Merge branch 'blender-v4.5-release' 2025-06-04 15:33:35 +02:00
Bastien Montagne
e66ebc5a5b Cleanup/Fix: BLO: Include missing header.
The `adjust_fcurve_key_frame_values` template uses enums from RNA
header, so directly include the relevant header.
2025-06-04 15:31:26 +02:00
Thomas Dinges
f224dbccce Revert "Release: Update 4.5 branch to beta"
This reverts commit ea5b1f7527.
2025-06-04 14:14:58 +02:00
Thomas Dinges
2aba7ec802 Merge branch 'blender-v4.5-release' 2025-06-04 14:13:55 +02:00
Thomas Dinges
ea5b1f7527 Release: Update 4.5 branch to beta
Splash by Blender Studio
2025-06-04 14:10:17 +02:00
Thomas Dinges
ccbcde4adb Release: Bump main to 5.0
Splash by Blender Studio
2025-06-04 13:55:07 +02:00
Bastien Montagne
456a07c5e6 Improve Blender resilience to blendfile DNA data corruption.
This commit improves DNA parsing resilience to data corruption in two ways:
* Detect and abort on failure to allocate requested amount of memory.
* Detect multiple usages of the same `type_index` by different struct
  definitions.

The second part fixes the `dna_genfile.cc:1918:40.blend` case reported
in #137870.

Pull Request: https://projects.blender.org/blender/blender/pulls/139803
2025-06-04 12:53:27 +02:00
Anthony Roberts
8ac5feb676 Windows ARM64: Rebuild OpenVDB for blosc changes
Ref: #139792

Pull Request: https://projects.blender.org/blender/blender/pulls/139824
2025-06-04 12:33:23 +02:00
Omar Emara
6bf52d11f1 Fix #139327: Movie distortion result is cropped
The Movie distortion node crops its data if the movie size differs from
the input size. That's because boundary extensions do not take
calibration size into account. To fix this, we use the same coordinates
range as the distortion grid computation, which computes the distortion
in the space of the calibration size.

Pull Request: https://projects.blender.org/blender/blender/pulls/139822
2025-06-04 12:24:33 +02:00
Falk David
889751b0c5 Grease Pencil: Add Convert Curve Type operator
Adds a new operator in Grease Pencil edit mode to convert between curve
types. This acts as a replacment for the `Set Curve Type` operator as
the new operator better aligns with previous workflows and artist
expectations. Specifically using a threshold to adjust how well the
resulting curves fit to the original.

It can be found in the `Stroke` > `Convert Type` menu.

This operator aims at keeping visual fidelity between the curves. When
converting to a non-poly curve type, there's a `threshold` parameter
that dictates how closley the shapes will match (a value of zero meaning
an almost perfect match, and higher values will result in less accuracy
but lower control point count).

The conversion to `Catmull-Rom` does not do an actual curve fitting.
For now, this will resample the curves and then do an adaptive
simplification of the line (using the threshold parameter)
to simulate a curve fitting.

The `Set Curve Type` operator is no longer exposed in the
`Stroke` menu.

This also adds a new `geometry::fit_curves` function.

The function will fit a selection of curves to bézier curves. The
selected curves are treated as if they were poly curves.

The `thresholds` virtual array is the error threshold distance
 for each curve that the fit should be within. The size of the virtual
 array is assumed to have the same size as the total number of
 input curves.

The `corners` virtual array allows specific input points to be treated
as sharp corners. The resulting bezier curve will have this point and
the handles will be set to "free".

There are two fitting methods:
* **Split**: Uses a least squares solver to find the control
                     points (faster, but less accurate).
* **Refit**: Iteratively removes knots with the least error starting
                     with a dense curve (slower, more accurate fit).

Co-authored-by: Casey Bianco-Davis <caseycasey739@gmail.com>
Co-authored-by: Hans Goudey <hans@blender.org>

Pull Request: https://projects.blender.org/blender/blender/pulls/137808
2025-06-04 11:48:15 +02:00
Pratik Borhade
0764217fb9 Fix #125974: Theme: TreeView list items use wrong theme settings
Set `UI_BLOCK_LIST_ITEM` flag for the block this will assign
`UI_BUT_LIST_ITEM` flag for tree view label buttons, see: `uiItemL_()`
That way `wcol_list_item` is being used for tree view.
(see: `widget_state()` / `widget_state_label()`

Pull Request: https://projects.blender.org/blender/blender/pulls/126026
2025-06-04 11:26:36 +02:00
Clément Foucault
2257ee7e56 GPU: OpenGL: Add support for non-blocking specialization
This avoid having to compile specializations JIT and
use the same API as subprocess compilation.

This bridges the gap between subprocess and threaded
compilation.

Pull Request: https://projects.blender.org/blender/blender/pulls/139702
2025-06-04 11:24:20 +02:00
Philipp Oeser
457cccd964 Fix #139782: USD MeshSequenceCache modifier using the wrong frame
It would run into using the same frame twice, looking like "freeze
frames"

Apparently we had a similar issue before, see 3f8ec963e3

Just a PoC to show that this looks like a precision/rounding issue when
getting a "working" `UsdTimeCode`.
In the modifier code, we are doing a roundtrip going from frame >> time
(in seconds -- via `BKE_cachefile_time_offset`) and then back to frame
before we store that in `USDMeshReadParams`.

To avoid the precision loss, this PR introduces
`BKE_cachefile_frame_offset` to stay in the "frame" domain and
circumvent going through FPS alltogether.

There might be better ways to let USD handle the "sightly off"
`UsdTimeCode` better though.

Pull Request: https://projects.blender.org/blender/blender/pulls/139793
2025-06-04 11:04:37 +02:00
Pratik Borhade
e24f46b12b Outliner: Support duplicating selected collections
Duplicating collection doesn't work when multiple collections are
selected, instead first selected collection is just duplicated. Now fixed
by iterating over list of selected collections returned by
`outliner_collect_selected_parent_collections` after traversing. In that
function, child collections are skipped if parent collection is already
selected, this avoids extra copies from being generated (i.e creates one
copy of nested collections).

Resolves #139651

Pull Request: https://projects.blender.org/blender/blender/pulls/139719
2025-06-04 11:00:44 +02:00
Jacques Lucke
36efa8d7a6 Fix: use getter function for Library.parent in RNA
Previously, this accessor didn't really work, because the `RNAPointer` would contain
the wrong pointer. I found that in #138485.

Pull Request: https://projects.blender.org/blender/blender/pulls/139817
2025-06-04 10:48:06 +02:00
Jacques Lucke
fc8695d6c5 Fix: assert in auto smooth operator
The check for whether the node group is valid requires the
interface cache.
2025-06-04 10:21:26 +02:00
Alaska
6e43896e86 Release note tool: Sort backport version numbers from lowest to highest
This commit adds a feature to the bug fixes per release tool to ensure
the version numbers of the backported Blender versions are in ascending
order.

Before: 4.2.9, 4.4.1, 4.2.9
After: 3.6.22, 4.2.9, 4.4.1

Pull Request: https://projects.blender.org/blender/blender/pulls/139011
2025-06-04 09:47:42 +02:00
Alaska
2c41ee58d1 Release note tools: Remove manual sorting of revert commits
In a previous commit (1) a feature was added to the bug fixes per
release script that prompted users if they want to sort revert commits.

This commit removes this feature, instead preferring that revert
commits are sorted in the overrides task (blender/blender#137983)

This was done because:
- The overrides task allows for greater control over how revert commits
  are classified, and it's synced between all users.
- The prompt to sort the commits appearing each time the script is run
  is annoying for triagers who may run the script multiple times in one
  day as they sort through various commits.

(1) blender/blender@9679d9a3eb

Pull Request: https://projects.blender.org/blender/blender/pulls/138505
2025-06-04 09:47:25 +02:00
Campbell Barton
47e26bdc0e Revert "Cleanup: remove unused functions in UI scripts"
This reverts most of commit 24eaff6889.

The some functions were used by C++.
2025-06-04 07:12:36 +00:00
Campbell Barton
24eaff6889 Cleanup: remove unused functions in UI scripts 2025-06-04 16:54:12 +10:00
Campbell Barton
8094e7c5f0 Cleanup: remove invalid comment 2025-06-04 16:53:07 +10:00
Campbell Barton
8fd17c4368 Fix edit-mode check when removing materials
Comparing the object with "edit_object" isn't correct as
multiple objects may be in edit-mode across multiple scenes.

Check the object for edit-mode data instead.
2025-06-04 16:25:17 +10:00