Commit Graph

151265 Commits

Author SHA1 Message Date
Lukas Stockner
7842b27326 GTest: Fix compiler warning with GCC 15
`<ciso646>` is deprecated in C++17, and now GCC 15 has started to complain,
so include an upstream commit that fixes this.

Pull Request: https://projects.blender.org/blender/blender/pulls/139417
2025-06-26 02:03:34 +02:00
Guillermo Venegas
e460ae24cb Refactor: UI: Replace uiItemEnumR* funtions with uiLayout methods
This converts the public functions to add enum specific property buttons
with uiLayout methods matching the python API.

Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/140941
2025-06-25 22:03:31 +02:00
Howard Trickey
ea65aa5ea1 Fix #140574: Manifold boolean leaves redundant 2-edged vertices.
This is discussed more in PR #140773.
The cause of the breakage was the change of the Manifold library
version from 3.0.1 to 3.1.0. That change is very positive otherwise
because we can remove the "use runids" workaround to prevent bad
face merging, and that removal is also part of this commit.
Removing that changes the time to do a big sphere-sphere test
from 660ms to 340ms.
The problem that needed fixing is that the new library version appears
not to do some aggressive simplification that the old version did,
and as a result, when we dissolve triangulation edges after the boolean
is done, it sometimes leaves valence-2 vertices on original edges.
To fix that, new code detects and then dissolves such vertices.
2025-06-25 15:32:01 -04:00
Germano Cavalcante
7ae173de39 Fix #140718: Incremental snap sometimes has wrong aspect
The 2 values in `t->snap` are not enough to indicate the transformation
value for each axis including precision.

Therefore, imitating the snap to grid solution, `t->snap` has been
replaced by `t->increment` and `t->increment_precision`.

Pull Request: https://projects.blender.org/blender/blender/pulls/140980
2025-06-25 17:31:01 +02:00
Julian Eisel
69eab999e0 Refactor: UI: Warn when not using result from UI layout getter functions
These functions were refactored recently, e.g. see e300d44e69. In some cases
it's less clear now which functions are getters and which are setters. Case in
point, I first thought `layout.use_property_split()` would enable property
split (that's what the name suggests). Previous names like
`uiLayoutGetPropDecorate()` and `uiLayoutSetPropDecorate()` were more clear.

By using the `[[nodiscard]]` attribute for getters, the compiler will emit
warnings when using such functions like a setter, without using the returned
value.
2025-06-25 16:45:36 +02:00
Bastien Montagne
0b52dcb0e0 Fix (unreported) logical error in Array IDProp copy code.
`IDP_ARRAY` properties storing `IDP_GROUP` data would not duplicate
these on copying, leading to two different array properties sharing the
same groups data...

NOTE: Uunclear how bad this issue was actually, since Blender itself will
never create such arrays of group IDProps afaik. At least could not find
any.

We really need to cleanup this code and add actual cpp-level unittests.
2025-06-25 16:19:31 +02:00
Campbell Barton
e7fe0932e6 Merge branch 'blender-v4.5-release' 2025-06-25 23:38:40 +10:00
Campbell Barton
5b06823f99 Fix #140929: Crash attempting to link from the current file from Python
Add an error check that the path being linked doesn't match the current
blend file.

Also resolve reference leak in the case of library override errors.
2025-06-25 13:37:52 +00:00
Clément Foucault
1a5f29cb07 Overlay: Move text cache managment to the Overlay::Instance
This avoid legacy code inside the DRWContext.

Note that this change the draw order w.r.t. gizmos. Now the
gizmos will hide the text.

Moreover, streamline the condition for enabling text drawing
in order to fix #78971.
2025-06-25 13:05:06 +02:00
Clément Foucault
e2c3d850cb Cleanup: Sequencer: Remove uneeded uniform creating warnings
The line width is already specified before the program bind
and the uniform doesn't even exists for `GPU_SHADER_3D_UNIFORM_COLOR`.

This might be the remains of an invalid use of the wide line
workaround.
2025-06-25 12:15:35 +02:00
Omar Emara
3b1d252431 Compositor: Support structure type
This patch adds support for the experimental structure types currently
used bu Geometry Nodes. Pixel nodes were declared as function nodes,
which gives dynamic structures for all their sockets. Other nodes now
explicitly declared their inputs as dynamic if not single value, while
the compositor_expects_single_value marker was removed in favor of the
StructureType::Single type.

Pull Request: https://projects.blender.org/blender/blender/pulls/140910
2025-06-25 11:54:48 +02:00
Clément Foucault
872c8fb189 Fix #77909: Viewport Render Image clamps output
The issue was that this operator is using the same
path as the viewport display. So the colors are
clamped if the display is not HDR.
This fix is easy now that we have an HDR path for
the viewport display. We just enforce using it
when doing the viewport render preview.
2025-06-25 11:28:50 +02:00
Habib Gahbiche
f2d95e758d Fix: Crash when opening files with animated compositor normal node
Saved files in 4.5 with a compositing node tree containing a Normal
Node with animated 'Dot' input crash in 5.0.

A test case with animated dot and normal inputs was added as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/140908
2025-06-25 11:04:29 +02:00
Clément Foucault
07ddd5065d Fix #87610: Workbench: World Cavity Not Scale-Agnostic
This is caused by the Attenuation property that is not
scale agnostic. We don't want to change its behavior as
it would break a lot of files. Instead, we allow users
to set its influence to 0 or less than 1 in order to
nullify or adjust its impact at larger AO radii.
2025-06-25 10:14:39 +02:00
Jacques Lucke
72110757b6 Fix: Geometry Nodes: links removed after syncing bundle/closure nodes
This makes sure that sockets keep their old identifiers so that links remain intact.

Pull Request: https://projects.blender.org/blender/blender/pulls/140956
2025-06-25 09:55:00 +02:00
Omar Emara
27e716a165 Fix: Crash when using coordinates in the compositor
The compositor crashes when using any image coordinates in GPU mode.
That's because the realization operation didn't support Float2 images so
far. To fix this, we handle Float2 images for realization.
2025-06-25 09:43:05 +03:00
Campbell Barton
98805d5403 Merge branch 'blender-v4.5-release' 2025-06-25 16:34:38 +10:00
Campbell Barton
8787366cca Merge branch 'blender-v4.5-release' 2025-06-25 16:34:34 +10:00
Campbell Barton
a2a1e4a159 Fix #140829: Crash after undoing "Set as Background" in video tracker
Operators that link data-blocks handled by undo must have the "UNDO"
flag enabled.
2025-06-25 16:32:28 +10:00
Jacques Lucke
f3d58ebb5b Fix: Geometry Nodes: crash with missing linked data-block
Geometry nodes can't be evaluated when the node tree is not available. This
never worked before and the modifier evaluation was "cancelled" later on before
already. However, new code in the modifier evaluation requires the modifier to
be cancelled earlier already which is what this patch does.

Pull Request: https://projects.blender.org/blender/blender/pulls/140923
2025-06-25 08:30:39 +02:00
Campbell Barton
def8b04492 Merge branch 'blender-v4.5-release' 2025-06-25 16:09:44 +10:00
Campbell Barton
3d852e4071 Fix #140439: Crash using "Edit Source" in popovers
Using "Edit Source" from a buttons context menu in a popover could
access freed memory when comparing buttons. Resolve by checking the
button still exists in the region.
2025-06-25 06:07:28 +00:00
Richard Antalik
ee0f7ad521 Merge branch 'blender-v4.5-release' 2025-06-25 07:16:38 +02:00
Richard Antalik
62e25e315a Fix #140740: Blender fails to output video
Caused by change in `AVCodecID` enum. Our `IMB_Ffmpeg_Codec_ID` enum,
which was stored in .blend file did match `AVCodecID`. But after change
in external library headers it fails to initialize correct codec.

Function `MOV_av_codec_id_get()` was added to map these 2 enums and
the values are no longer hard coded.

Functions, that accepted `int codec_id` argument were modified to accept
`IMB_Ffmpeg_Codec_ID` or `AVCodecID` types.

Because `codec_id` was still stored as integer in DNA, get/set struct functions
were added. This way, compiler always knows what type is used and emit
error/warning when incompatible types are used.

Unfortunately, there is no way to ensure, that DNA `codec_id` field is not
accessed directly in future code other than comment.

Pull Request: https://projects.blender.org/blender/blender/pulls/140745
2025-06-25 07:15:13 +02:00
Omar Emara
00d375755f Compositor: Avoid redundant executions for only previews
The compositor executes redundantly if previews are enabled but no
other output is computed. This shouldn't be the case because previews
are secondary outputs that need a primary output to compute with.

We improve this this by only executing the compositor if a primary
output is needed, regardless if previews are needed or not.

Pull Request: https://projects.blender.org/blender/blender/pulls/140920
2025-06-25 07:06:18 +02:00
Campbell Barton
5d553e1dd0 Merge branch 'blender-v4.5-release' 2025-06-25 04:42:53 +00:00
Campbell Barton
2a757f469c Fix cursor size being ignored by custom cursors under Wayland
The theme cursor size was ignored when setting custom cursors
such as the knife, only the DPI from GHOST was taken into account.

This meant cursors such as the knife would sometimes display too small.

Now when the theme-size is larger, a larger cursor will be used.

Currently the theme size is read from XCURSOR_SIZE environment variable
however it may be read from the system preferences in the future.

Also fix the software cursor sizes which incorrectly used the UI scale
preference which is ignored by cursor sizes.
2025-06-25 04:39:57 +00:00
Hans Goudey
a12f7717a1 Refactor: Attributes: Add assign_data function
Prevent an extra copy that could happen when calling
data_for_write() to retrieve mutable access, only to just
replace the data.

Pull Request: https://projects.blender.org/blender/blender/pulls/140946
2025-06-25 05:08:20 +02:00
Hans Goudey
25e0957f8e Cleanup: Attributes: Resolve reference binding to null warning
The sharing info might be null if the array is null / empty.
2025-06-25 05:08:18 +02:00
Hans Goudey
eadb259aee Fix: Attributes: Data potentially lost in versioning
For files saved with the new format, the versioning can incorrectly
replace the AttributeStorage data with whatever is inside of CustomData,
even if that's nothing. So far this is only in one unlikely case for
point clouds, but these functions will soon be used for Grease Pencil
and curves.
2025-06-25 05:08:18 +02:00
Hans Goudey
4e7ee26cb3 Cleanup: Attributes: Implement get_builtin_default for PointCloud
This is currently only used for curves, but it may be used elsewhere
in the future, so it's best to make sure it's implemented consistently.
2025-06-25 05:08:18 +02:00
Hans Goudey
b915da45d8 Cleanup: Attributes: AttributeOwner utility to retrieve storage
This helps share the implementation of many functions between
geometry types (in the future, now only point clouds at runtime).
2025-06-25 05:08:18 +02:00
Hans Goudey
94c2a7e0b5 Cleanup: Attributes: Add AttributeOwner function for accessor
This is a better way to make the existing static function available
outside of `attribute.cc`.
2025-06-25 05:08:18 +02:00
Hans Goudey
1c32de3095 Cleanup: Remove meaningless const for return by value 2025-06-25 05:08:18 +02:00
Hans Goudey
4b4314483d Cleanup: Attributes: Properly use unitialized memory for copy
Add a "ForUninitialized" utility function and use copy construction
correctly. This doesn't make a difference yet because we only
have trivially constructible attribute types so far.
2025-06-25 05:08:18 +02:00
Ramon Klauck
53578d33ae VSE: Keyframing in Preview
This PR makes it easier to add keyframes for strips in preview.
This works same way as in 3D viewport, using keying sets. Pressing I
key adds keyframe to default keying set, pressing K dhows menu with
available keying sets. For VSE, location, rotation and scale properties
are available for now. Other existing keying sets are not valid for
VSE.

Deleting keyframes and potentially adding more keying sets will be
handled in separate PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/140107
2025-06-25 02:56:55 +02:00
Ray Molenkamp
e21cb781fb Merge remote-tracking branch 'origin/blender-v4.5-release' 2025-06-24 18:47:35 -06:00
Ray Molenkamp
e37d544e86 Deps: Win64: USD with PR #140102 2025-06-24 18:44:25 -06:00
Sean Kim
27433106cd Cleanup: Use C++ types and functions for multires_reshape_apply_base
Also converts a manually managed temporary array with `blender::Array`

Pull Request: https://projects.blender.org/blender/blender/pulls/140784
2025-06-25 01:06:48 +02:00
Sean Kim
9d3c038a27 Cleanup: Use C++ math types and functions for displacement Evaluator
Pull Request: https://projects.blender.org/blender/blender/pulls/140789
2025-06-25 01:05:06 +02:00
Sean Kim
64e237d074 Cleanup: Use C++ math types and functions for multires_reshape_smooth.cc
This doesn't yet touch lines that use the `ReshapeGridElement` or
`ReshapeConstGridElement` structs, those require further cleanup
elsewhere before making such changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/140782
2025-06-24 23:56:10 +02:00
Sean Kim
1a7ebffeca Cleanup: Use C++ math types and functions for multires_reshape_util.cc
This commit does not change lines that access the `ReshapeGridElement` or
`ReshapeConstGridElement`, that cleanup will follow in a later commit.

Pull Request: https://projects.blender.org/blender/blender/pulls/140783
2025-06-24 23:50:55 +02:00
Clément Foucault
6535c999e0 Cleanup: Overlay: Avoid motion path issuing warn about missing uniforms 2025-06-24 22:09:09 +02:00
Clément Foucault
92b93d6d77 Fix #120969: Overlay: Assert when drawing motion paths
Avoid out of bound reads.
2025-06-24 22:09:02 +02:00
Hans Goudey
8c71719dfd Refactor: UI: Use std::string for uiLayout heading string
Changes the size of uiLayout from 408 to 184 bytes.
2025-06-24 15:09:21 -04:00
Sean Kim
a50a88a656 Merge branch 'blender-v4.5-release' 2025-06-24 12:06:10 -07:00
Sean Kim
c542dad3c6 Tests: Add basic subdivision tests for Multires modifier
This test replaces the existing multires modifier test with one that
subdivides the mesh and then compares the result. The existing one has
little purpose, as it applies a modifier with 0 subdivision levels.

Pull Request: https://projects.blender.org/blender/blender/pulls/140567
2025-06-24 21:05:16 +02:00
Guillermo Venegas
2e5138fed8 Refactor: UI: Replace uiItemPointerR with uiLayout::prop_search
This converts the public uiItemPointerR and uiItemPointerR_prop
functions to an object-oriented API (uiLayout::prop_search overloads),
matching the python API.

Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/140930
2025-06-24 20:47:54 +02:00
Sean Kim
74fbeeeccb Merge branch 'blender-v4.5-release' 2025-06-24 10:28:14 -07:00
Sean Kim
f99b35463a Tests: Remove suite level apply_modifiers option for modifier tests
The `apply_modifiers` property of the `RunTest` class overrides
all of the test level `apply_modifier` properties. This prevents
modifiers from manually specifying when a modifier is applied and forces
the modifier to be applied immediately after it is added.

The vast majority of tests do not override the `apply_modifier`
property, the primary usecase for this property is to work in
combination with the `do_compare` property to allow examining the
corresponding .blend file to debug test failures.

This commit simplifies the settings by removing this parameter. It now
only disables applying the modifier if `do_compare` is set to False.

Pull Request: https://projects.blender.org/blender/blender/pulls/140893
2025-06-24 19:27:36 +02:00