Commit Graph

152723 Commits

Author SHA1 Message Date
Mattias Fredriksson
a57c3558cd Curves: Unit tests for curves::nurbs::calculate_evaluated_num()
Unit tests veryfying expectation for curves::nurbs::calculate_evaluated_num().
Expectation is computed from closed form expressions rather then hard coded
values. Purpose for this is to make the tests easier to adjust if, for example,
parameter sampling pattern is changed. It should also make them easier to read
and understand.

Additional purpose is to create a baseline and verify changes for #144000.

Implementation is essentially examples from:
https://link.springer.com/book/10.1007/978-3-642-59223-2

Pull Request: https://projects.blender.org/blender/blender/pulls/143920
2025-08-06 13:59:10 +02:00
Omar Emara
c3688f7bb7 Fix #136939: Translation is ignored in some nodes
The compositor ignores translation in certain nodes like Corner Pin.
Users find this unexpected as adjusting the translation of the input has
no effect on the output. The only alternative logical thing to do if
translation exists is to clip the image, which this patch do.

This affects the following nodes:

- File Output.
- Map UV (Image input).
- Corner Pin.
- Plane Track Deform.
- Bokeh Blur (Bokeh Kernel input).

Pull Request: https://projects.blender.org/blender/blender/pulls/144049
2025-08-06 13:46:34 +02:00
Hans Goudey
3724ebeaa6 Refactor: Extract BMesh attribute lookup function
This is the second time I've needed a function to find an attribute by
name on all attribute domains, with a third time coming soon. It seems
time to put this in a BMesh header.

Pull Request: https://projects.blender.org/blender/blender/pulls/144039
2025-08-06 13:40:51 +02:00
Hans Goudey
b2d0b9535f Fix #143739: Operator redo broken for duplicate move
In this case the depsgraph isn't necessarily evaluated before the
transform operator executes. We need to make sure there's an evaluated
depsgraph so the evaluated deform positions are updated based on the
duplicate operator (the first step of the operator macro).

Pull Request: https://projects.blender.org/blender/blender/pulls/144037
2025-08-06 13:38:49 +02:00
Nig3l
4bede1b555 Image Mask Editor: Expose tools in the Toolbar
Expose existing mask operators as tools in the toolbar.

The primitive tools are commented out since interactively placement
isn't currently supported by the operators.

Ref !136086
2025-08-06 09:44:24 +00:00
Omar Emara
77bb71d8da Fix: Wrong structure type for Transform node output
The output of the Transform node in the compositor has a single value
structure type, while it should be dynamic.
2025-08-06 12:33:44 +03:00
Clément Foucault
b903d3ade3 Fix #143336: Frustum culling is incorrect in Blender 4.5
Caused by a compiler issue with function accessing the same SSBO in
different control flow.

Loading the SSBO data before doing the computation fixes the issue.

Candidate for Backporting to 4.5 LTS.

Pull Request: https://projects.blender.org/blender/blender/pulls/143926
2025-08-06 10:41:23 +02:00
Campbell Barton
aaedeb3852 Fix #143838: hotkey customization's aren't saved for custom operators
Operators registered after the key-map was initialized would not have
their user customization's loaded from user preferences.

Resolve by tagging the keymap to be updated when appending operators
as well as removal, this only runs the updates when appending
operators after startup.

May also resolve #126641.
2025-08-06 08:09:50 +00:00
Campbell Barton
c54b981b14 Cleanup: rename the keyconfig operator type update function
Use a tag suffix since this read as if it might perform the update.
2025-08-06 18:03:16 +10:00
Campbell Barton
e8501d2f54 Cleanup: grammar corrections, minor improvements to wording
Also back-tick quote some code references in comments
to differentiate them from English text.
2025-08-06 00:20:39 +00:00
John Kiril Swenson
641e4aed95 Cleanup: VSE: Remove StripData.start/endstill
Not to be confused with `Strip.start/endstill` which were renamed with
a legacy suffix. The `StripData` version here isn't present anywhere
in versioning code or otherwise, so it should be safely removable.

Reduces the size of this struct by 8 bytes.

Pull Request: https://projects.blender.org/blender/blender/pulls/143874
2025-08-06 01:37:20 +02:00
John Kiril Swenson
54c63c4138 Cleanup: VSE: Rename deprecated DNA fields with _legacy suffix
No functional changes intended.
2025-08-06 01:37:16 +02:00
John Kiril Swenson
cedf2d9949 Cleanup: VSE: Add deprecation notices to DNA, improve comments
- Add `DNA_DEPRECATED` macros, and comments noting when the fields were
  deprecated
- Improve other comment clarity
- Other small casing fixes and tidying of the file.
2025-08-06 01:37:16 +02:00
Sean Kim
ba291976b2 Fix #143399: Vertex Paint subtract blend mode can cause artifacts
Error in 96e549c092.

The order of colors passed into `BLI_mix_colors` is significant in cases
where the alpha being used is 0. The intent of this line is that the
temporary stroke buffer should have the value of mixing the brush color
with the current buffer value.

Pull Request: https://projects.blender.org/blender/blender/pulls/143972
2025-08-05 22:52:34 +02:00
Laurynas Duburas
c59a1aedbf Curves: Add "Curve Data" edit mode panel
Adds "Curve Data" panel analogous to "Active Spline" in legacy curves.
This allows setting values both for single and multiple selected curves.
If a particular field's value differs among selected curves, the mean
value is shown in inactive field. The field is modifiable and input
value is set to all selected curves.

Pull Request: https://projects.blender.org/blender/blender/pulls/141572
2025-08-05 22:25:06 +02:00
Harley Acheson
df7da7ef21 UI: VFont Placeholder Size Correction
This PR scales the VFont placeholder character so that it is always
approximately en width. It is currently too wide and scales the size
and line width incorrectly for different font dimensions.

Pull Request: https://projects.blender.org/blender/blender/pulls/143812
2025-08-05 19:31:44 +02:00
Hans Goudey
2a8da4c1fa Fix #143952: Broken Grease Pencil edit lines overlay in some cases
Caused by 5f6e94ca58

When there are more than 2^16 points, the GPU index buffer code tries
to compress the indices to uint16 because we passed the incorrect max
index. In general that optimization just isn't worth the complexity
of precalculating the max index in this situation. There are other
potential optimizations here that would be vastly more helpful.
So just pass INT_MAX to disable the compression.
2025-08-05 12:56:26 -04:00
Hans Goudey
1d34381abd Cleanup: Fix missing declaration warnings in compositor 2025-08-05 12:11:27 -04:00
Sybren A. Stüvel
0fa67c3ea2 Fix #142464: Add customizable color for W quaternion channel
The W channel in quaternion and axis-angle F-Curves is now themeable
(defaulting to yellow), instead of incorrectly blending the X and Y axis
theme colors.

The original blending math did not take into account that the hue
channel actually wraps around, and so the blended color became blue
instead of the intended yellow.

Instead of fixing the math, the theme has been expanded for this W axis.
The default color is set to the mathematically correct yellow.

Co-authored-by: Sybren A. Stüvel <sybren@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/143211
2025-08-05 17:55:12 +02:00
Jacques Lucke
0f65acef25 Fix #143839: missing warning when connecting field to single value
The behavior of the field inferencing changed slightly. So instead of checking
if the link connects a socket that has a field to one that does not, check the
source is a field and the target does not support one. Note the difference
between "having a field" and "supporting a field".

This was probably broken in 7b7c630018.

Pull Request: https://projects.blender.org/blender/blender/pulls/143975
2025-08-05 16:28:16 +02:00
Jeroen Bakker
8bfcb5e509 Fix #142093: Fix crash when entering sculpt mode
In case an image editor is open in the same window, entering sculpt mode
could crash. The cause is that the 3d viewport can request the sculpt
data vbo and its batch. But the image editor doesn't need it and removes
the sculpt data vbo, but doesn't remove the batch. Next frame the batch
could point to invalid data.

This fix will not keep the batch around so it is always being
reconstructed. A better solution needs to be found as the removal of the
vbo is done in a strange part, and the vbo should be checked against the
cd needed over time.

Pull Request: https://projects.blender.org/blender/blender/pulls/144013
2025-08-05 16:26:55 +02:00
Omar Emara
32acd9dfa5 Fix #143925: File Output writes single values for Multi-Layer EXR
The File Output node writes single value images for Multi-Layer EXR,
while it should skip such cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/143990
2025-08-05 16:18:24 +02:00
Habib Gahbiche
00f82920ef Tests: Compositor: update File Output Node tests
'exr multilayer passes' had an invalid input, so its output was updated

The rest of the tests had outdated output sockets after some 'Color'
sockets were converted into 'Vector' sockets

Pull Request: https://projects.blender.org/blender/blender/pulls/144004
2025-08-05 15:42:14 +02:00
Clément Foucault
c0a0962450 Workbench: Change fallback in Attribute color mode to Material
This was a request of the Blender Studio.

The Attribute color mode is used for more correct display of
materials during animation. The assets are created with
a color attribute that mimics the material.
The issue is that this attribute needs to be set up for every
individual object for it to work in Attribute color mode as
the lack of attribute will default the object to Object color mode.

This patch changes the defaulting to Material color mode
just like when using the Texture color mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/143931
2025-08-05 14:48:49 +02:00
Michael Jones
50363918c7 Cycles: Stop Metal API validation asserts
Dynamic enqueue arguments weren't padded out to struct alignment causing API validation to assert.

Pull Request: https://projects.blender.org/blender/blender/pulls/143991
2025-08-05 14:45:14 +02:00
Jeroen Bakker
1f47a51335 Fix #142305: Vulkan: Memory leak immediate mode
Resetting and recycling of immediate drawing buffers was never done and
would leak memory as the buffers were only destroyed when Blender
exited.

This is solved by not recycling or resetting the buffers and rely on the
discard pools. Additional cleanup of removing unused code-paths is also
part of this change so it can be backported to 4.5.

Pull Request: https://projects.blender.org/blender/blender/pulls/143995
2025-08-05 14:40:54 +02:00
Falk David
00a979f2aa Fix #143802: Grease Pencil: Divide blend mode not working in viewport
For the "Divide" layer blend mode to work in the viewport, we need to use
a floating point texture format for rendering.

This changes the format to always use floats for the `color` textures,
but still switches the `reveal_tx` to use integers in the viewport, and
only floating point during final render.

Pull Request: https://projects.blender.org/blender/blender/pulls/143993
2025-08-05 14:23:49 +02:00
Sergey Sharybin
e4fc33adfc Fix #143775: Cryptomatte: Precision issues with matte output
The issue has been introduced in 7ceb4495c5 by missing implementation
of the is_noop() callback for the CPU processor.

While it was not noticeable perceptually, an exact floating point value
might have changed due to un-premultiplication+premultiplication.

The fix needs to be ported to the Blender 4.5 LTS.

Pull Request: https://projects.blender.org/blender/blender/pulls/143998
2025-08-05 14:08:08 +02:00
Omar Emara
34ccb88921 Fix: Viewport compositor passes does not work with Group Input
The Group Input node can not access viewport compositor passes, this is
because EEVEE only considered render layers node. This fixes that by
also taking root group input nodes into consideration.

Pull Request: https://projects.blender.org/blender/blender/pulls/143996
2025-08-05 13:42:43 +02:00
Bastien Montagne
0d2295a538 Fix (unreported): Compositor Cryptomate could crash in some cases.
Cryptomate's init process would access the scene's viewlayers even when
`build_meta_data` was false - and the `CryptomatteSession` constructor
would only ensure valid viewlayers if `build_meta_data` is `true`.

Triggered in a complex setup (BCon25 app template), but suspect this was
reproducible when the compo node tree is used in a non-active scene.
2025-08-05 12:33:25 +02:00
Falk David
b833b9daac Fix: VSE: Wrong context used when dropping audio files
The `start_audio_video_job` function was using `CTX_wm_window`
and `CTX_data_sequencer_scene` which shouldn't be populated when
the callback is called.
The reason for this is that this callback is executed once on drag enter,
but there isn't a vaild context at that moment.

The fix removes the use of the context functions since we don't need
the context members. The window was always `nullptr` anyway and the
`scene` was just _a_ scene, but not necessarily the correct one.
For audio files, we need the scene framerate to compute `strip_len`
which is used to draw a temporary strip in the VSE timeline.
But instead of computing the `strip_len` on drag enter, we compute
it on the fly when drawing the temporary strip since we have the
right context then.

Pull Request: https://projects.blender.org/blender/blender/pulls/143981
2025-08-05 12:27:54 +02:00
Pratik Borhade
58d078fa3d UI: Tree View: Rename with F2
Luckily operator to rename already exists `UI_OT_view_item_rename`, just
need to add that in the keymap

Pull Request: https://projects.blender.org/blender/blender/pulls/143978
2025-08-05 11:58:39 +02:00
Habib Gahbiche
ac134c5a51 Compositor: Use frame for Map Value node versioning
Ref: #143441

The Map Value node was removed. During versioning, it gets replaced by
other equivalent nodes.
This PR adds a frame around the newly created nodes with a label that
clarifies the reason these nodes were added.

Pull Request: https://projects.blender.org/blender/blender/pulls/143800
2025-08-05 11:39:56 +02:00
Sybren A. Stüvel
e239c7f43c Anim: fix printf format string
Use `PRId64` for `int64_t` values, to appearse both clang and gcc.

The warnings were introduced in efef8a201a

Pull Request: https://projects.blender.org/blender/blender/pulls/143979
2025-08-05 11:37:28 +02:00
Damien Picard
5998795aa6 UI: Replace contractions with long-form text
Avoid using contractions for can't, aren't, doesn't, and shouldn't.
Following the writing style guide in the Human Interface Guidelines.

Pull Request: https://projects.blender.org/blender/blender/pulls/143852
2025-08-05 11:16:22 +02:00
Benjamin Beilharz
570f44a059 Compositor: Extension modes for corner pin mode
This commit introduces the extension modes to the corner pin node and
further streamlines the node properties by wrapping all props in the node
storage. Therefore, the interpolation mode has been removed from the
custom properties of the node and moved into the node storage.

Right now, the extension modes only work for non-anisotropic filtering.

Pull Request: https://projects.blender.org/blender/blender/pulls/141570
2025-08-05 11:12:54 +02:00
Ian Yoo
f6523e619a Tests: Add group node test for missing output node
This adds a test case for #142944 where the compositor crashes when
there is a missing group output node inside a group node.

Pull Request: https://projects.blender.org/blender/blender/pulls/143150
2025-08-05 11:06:44 +02:00
Sybren A. Stüvel
f7a033e547 Fix: AssetShelfSettings memory management issues (assignment & destructor)
Rewrite `AssetShelfSettings::operator=` and fix `~AssetShelfSettings()`
to address some memory management issues:

- `memcpy` was used to copy a C++ struct, which shouldn't be done: it
  can cause undefined behaviour if the class has vtables or internal
  padding. This isn't the case here, but GCC nonetheless warns for it.
- `active_catalog_path` was incorrectly freed via `MEM_delete()`; it was
  allocated with `BLI_strdup()`, which uses `MEM_malloc_arrayN()` and
  thus should be freed with `MEM_freeN()`.
- Self-assignments weren't handled properly, and could cause data loss.

These are now all fixed.

Pull Request: https://projects.blender.org/blender/blender/pulls/143701
2025-08-05 11:03:31 +02:00
Bastien Montagne
f453c189f8 make format 2025-08-05 11:02:21 +02:00
Clément Foucault
83c5e81a8b Fix #143857: View3D smooth interpolation produces invalid rv3d.dist values
In the particular case of the report it creates a rv3d with `dist == 0`.

This causes EEVEE to create an invalid projection matrix when
calling `RE_GetWindowMatrixWithOverscan` with a zero `viewplane`.

To avoid this, we check if `rv3d->dist == 0` and don't compute overscan
in this case. This avoid many issues down the line.

Candidate for backporting to 4.5 LTS.

Pull Request: https://projects.blender.org/blender/blender/pulls/143946
2025-08-05 11:01:03 +02:00
Bastien Montagne
d3f6523536 tests: Add basic performance test for bpy/RNA API.
These tests check performances of ID python wrapper creation (these are
cached), regular RNA struct wrapper creation, acess to IDProperties,
(un)registering of py-defined PropertyGroup, and access to py-defined
properties (without and without custom get/set).

The goal of these tests is mainly to follow performances impact of
on-going refactors and improvements in the BPY/RNA area.
2025-08-05 10:41:08 +02:00
Jeroen Bakker
9d039ef29e Fix #141806: Crash with certain layers enabled
This PR removes the deferred allocation of swapchain images. A lot of layers
don't support this and will crash when used.

Thanks to Jorn Visser to point out the potential issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/143924
2025-08-05 10:11:06 +02:00
Clément Foucault
5b15894d7c Fix #143294: Blended surface not receiving volume properly
The `gl_FragCoord.z` is now containing the reverse Z and
should be passed through the `read` function.

Candidate for backporting to 4.5 LTS.

Pull Request: https://projects.blender.org/blender/blender/pulls/143950
2025-08-05 09:57:13 +02:00
Omar Emara
264a316984 Fix #141173: Inpaint node inconsistent on GPU
The Inpaint node produces inconsistent results across different GPUs,
where it produces different results on Intel Windows GPU platforms. This
is due to a mismatch between the precision declared for the shader and
that of the allocated textures. To fix this, we make sure the shader
uses the same precision as the allocates results.

Pull Request: https://projects.blender.org/blender/blender/pulls/143793
2025-08-05 09:45:34 +02:00
Christoph Lendenfeld
5fcd624bd6 Fix: Poll function for asset screenshot operator
The issue was the usage of `asset_edit_id_is_editable` which seems to also return
true for external libraries that are not `asset.blend`

The fix is to use  `asset_edit_id_is_writable`

Fixes: #142124
Pull Request: https://projects.blender.org/blender/blender/pulls/141942
2025-08-05 09:09:17 +02:00
Christoph Lendenfeld
befe6062c0 UI: Icons for playhead snapping
The recently introduced feature of playhead snapping (#137278)
added a popover menu for snap targets.
This used text to indicate the contents of said popover.
In order to bring it in line with the other snapping menu, this PR adds
icons to indicate the enabled state of snapping.

Part of #135794

Pull Request: https://projects.blender.org/blender/blender/pulls/139271
2025-08-05 09:01:56 +02:00
Tenkai Raiko
de9b24abad Fix: Map UV node does not work with single values
The Map UV node does not work when the UV input is a single value, where
it is expected that the output will also be single value. This was
simply not implemented for GPU, so this patch does that.

Pull Request: https://projects.blender.org/blender/blender/pulls/143096
2025-08-05 08:09:25 +02:00
Jacques Lucke
2c435ce8df Fix #141469: Geometry Nodes: use safer approach to modifying each instance geometry
Many nodes operate on all the instances that are passed into them. For example,
the Subdivision Surface node subdivides the mesh at the root but also instanced
meshes. This works well for most nodes, but there are a few nodes were the old
`modify_geometry_sets` function was not very well defined and it was tricky to
use correctly.

The fundamental problem was that the behavior is not obvious when a node creates
or modifies instances and how those are integrated with the already existing
instances.

This patch solves this with the following changes:
* Remove the old `GeometrySet::modify_geometry_sets` and related
  `*_during_modify` methods.
* Add a new `blender::geometry::foreach_real_geometry` function that is similar
  to the old `modify_geometry_sets` but has a more well-defined interface:
  * It never passes instances into the callback. So existing instances can't be
    modified with it.
  * The callback is allowed to create new instances. This will automatically be
    merged back with potentially already existing instances. The callback does
    not have to worry about accidentally invalidating existing instances like
    before.
* A few existing usages used `modify_geometry_sets` to actually modify existing
  instances (usually just removing attributes). Those can't use the new
  `foreach_real_geometry`, so they just get a custom simple recursive
  implementation instead of using a generic function.

Pull Request: https://projects.blender.org/blender/blender/pulls/143898
2025-08-05 06:25:20 +02:00
Jacques Lucke
b9b71dbb71 Refactor: Nodes: slightly generalize drawing node errors
The goal here is it to make it more obvious how error messages for
shader nodes should be added. Nowever there is a more explicit
block for compositer and geometry nodes.
2025-08-05 06:24:52 +02:00
Hans Goudey
f5f9c4f444 Fix #143450: Bevel modifier crash with free normals
If the BMesh already has a "custom_normal" attribute with the wrong
type, the call to `BM_lnorspace_update` won't be able to add the
attribute with the expected name, and the bevel code ends up using an
invalid offset to access the data.

For the fix, first just guard against that case. But also make sure the
harden normals functionality still works when the input mesh has free
normals. They will no be converted to tangent space normals as
necessary, in bevel and in other BMesh code that requires that
custom normal storage format.

Pull Request: https://projects.blender.org/blender/blender/pulls/143489
2025-08-05 04:45:49 +02:00