Commit Graph

153913 Commits

Author SHA1 Message Date
Campbell Barton
66c19a21d8 Fix #145557: Memory leak on exit with custom wayland cursor shapes
While the leak only occurred on GNOME, there is no guarantee the
compositor releases cursor buffer before exiting.
2025-09-16 15:25:14 +10:00
Campbell Barton
96d7c5c4cd Cleanup: use braces in mathutils switch statements
Also move error checking before variable declarations.
2025-09-16 14:53:58 +10:00
Oxicid
b2176bfdd7 PyAPI: use the vectorcall protocol for mathutils types
The Vectorcall protocol avoids creating a tuple, and also provides the
number of arguments in advance, providing a ~1.6x speedup for creation
of mathutils types.

Ref !146237
2025-09-16 04:50:38 +00:00
Jesse Yurkovich
d26a79b144 Core: Reduce cost of DupliObject random_id generation
Each dupli is given a PersistentId which is 8 integers, 1 for each level
of recursive duplication that Blender supports. When an instance belongs
to fewer than 8 levels, the id is padded with sentinel values for the
remaining levels. For example, a 2 level dupli may have a persistent id
like:`[7, 4, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX]`

When calculating the instance's `random_id` we were considering all 8
values of the Persistent Id which is unnecessary and wasteful. Now we
only use the minimal values necessary. This does mean that the Object
Info: Random material socket changes values from prior versions however.

This improves the performance of the viewport in some instancing
scenes by roughly 4-6%.

Co-authored-by: Bastien Montagne <mont29@noreply.localhost>
Pull Request: https://projects.blender.org/blender/blender/pulls/145150
2025-09-16 02:15:43 +02:00
Lukas Stockner
dcc5ac4e44 Fix: Cycles: Metal error in unrelated test after Sky Texture change
For some reason, the `underwater_caustics` test was failing on Metal
after #140480 even though that test doesn't use the Sky Texture.

After messing with the file for a while, going back to the previous version
and adding the changes back one at a time, I've now arrived at a version
that behaves the same way as the #140480 version without breaking the test.

No idea what is the underlying issue, but we've had problems with the MNEE
kernels before so maybe just a compiler thing.

Pull Request: https://projects.blender.org/blender/blender/pulls/146335
2025-09-16 01:15:18 +02:00
Hans Goudey
c9cd749bf1 Cleanup: Use attribute API for "Reset UVs" function
Also make the implementation local, and take an attribute name
argument rather than the index of the UV map.

Pull Request: https://projects.blender.org/blender/blender/pulls/146342
2025-09-15 23:09:35 +02:00
Hans Goudey
0686ceffd1 Fix: Geometry Nodes output attributes hidden
Caused by ad27211b77
2025-09-15 15:35:18 -04:00
Jeroen Bakker
47fc709987 Fix #146313: Vulkan: Memory leak HDR backbuffer shader
Oversight in !146170 where shader pointers where overwritten each
frame. Should also be a performance regression.

Pull Request: https://projects.blender.org/blender/blender/pulls/146319
2025-09-15 21:01:25 +02:00
Casey Bianco-Davis
ce2005318a Fix: Grease Pencil: Points with zero aspect ratio not displayed
A aspect ratio less than or equal to zero will cause point to not be
displayed.
This behavior problematic because use strokes create by Geometry Nodes
(or bugs) can cause the `aspect_ratio` to default to zero.
And as there is currently no operator to set `aspect_ratio` this
invisible geometry can not be fixed by most users.

This PR fixes this by returning `1.0f` when the `aspect_ratio` is
invalided.

Pull Request: https://projects.blender.org/blender/blender/pulls/146279
2025-09-15 18:51:33 +02:00
Casey Bianco-Davis
4fb784b97f Fix #142691: Grease Pencil: Reset Vertex Color obstructs materials
The default value for the `vertex_color` attribute is `0.0f` not `1.0f`
so the `Reset Vertex Color` operator should set zero, to no obstruct
the base material.

Candidate for backport to 4.5 LTS.

Pull Request: https://projects.blender.org/blender/blender/pulls/146277
2025-09-15 18:41:00 +02:00
Casey Bianco-Davis
51f9fccc81 Fix: Grease Pencil: Draw tool default aspect_ratio and u_scale to zero
The draw tool would create the `aspect_ratio` and `u_scale` attributes
if they did not exist, but would set them to `0.0f` not `1.0f`

Pull Request: https://projects.blender.org/blender/blender/pulls/146276
2025-09-15 18:38:05 +02:00
Lukas Stockner
4eee95c0f9 Fix: Cycles: Incorrect thin film IOR for backfacing Glass with OSL
Thanks to @main-menu-theme for noticing this!
2025-09-15 18:21:15 +02:00
Pablo Vazquez
ae7f3a0d18 Fix #146284: Missing Navigation Bar in Preferences
Follow up to !146169

- Add versioning so the new sidebar shows up in old files.
- Remove the hidden flag so it shows up in new Preferences editors.
- Add "Sidebar" toggle to the View menu, and expose region toggle.

Pull Request: https://projects.blender.org/blender/blender/pulls/146321
2025-09-15 18:11:37 +02:00
marcopavanello
084aefd0e0 Render: Add Multiple Scattering Sky Texture
This mode is based on the same athmospheric model as the previous one, but now
also accounts for multiple scattering and reflections from the ground.
This increases the accuracy, especially at low elevations.

Also renames some options for consistency:
- The previous "Nishita" model is now "Single Scattering"
- "Dust" is now "Aerosols"
- Default altitude is now 100m.

Co-authored-by: Lukas Stockner <lukas@lukasstockner.de>
Pull Request: https://projects.blender.org/blender/blender/pulls/140480
2025-09-15 18:08:28 +02:00
Hans Goudey
cf0703aa6e Sculpt: Improve and optimize undo data compression
Prefilter the position float data similar to what was done recently for
point caches in 3d9155eb0a (more information about this
compression technique is linked there). Also avoid reallocating an
array for temporary data when processing each BVH node. The results
are great relative to the size of the change:

- Building the compressed undo step data gets 5.2x faster (25 to 5 ms)
- Restoring the compressed undo step on undo is 1.8x faster (10 to 5 ms)
- The memory usage for an undo step is 1.6x smaller (23 to 14 MB)

I Tested on a mesh with 1.8 million vertices, with an operation affecting
the entire mesh. The mesh data affected will have an affect on the results.

Pull Request: https://projects.blender.org/blender/blender/pulls/146093
2025-09-15 17:57:36 +02:00
Sybren A. Stüvel
b466c6a99f Fix #145635: Tree View: Selection not working
Adjust the poll function of the 'Set Active Modifier' operator
(`object.modifier_set_active`) to only return `true` when it's run in a
context that actually may have a modifier. This makes it work in the
Modifiers panels, but not in other panels, so that the 'mouse click'
event can be used for other operators (like tree view selection).

This is not a perfect solution, as the modifier panel may use tree views
in some future as well, but at least it seems to fix the 'unbreak now'
issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/146325
2025-09-15 17:49:07 +02:00
Casey Bianco-Davis
63a5206145 Fix: Curves: Select Alternate operator not selecting handles
This makes it so that the `Select Grouped` operator will selected Bezier
handles. And Points with handles selected will be used included in the
group.

Part of #121574

Pull Request: https://projects.blender.org/blender/blender/pulls/145191
2025-09-15 17:37:21 +02:00
Clément Foucault
50283b9573 GPU: Split GLSL, C++ and metal shader defines
This makes all the defines and boiler plate code use
the generated source include system.

This makes source hierarchy more understandable.

Pull Request: https://projects.blender.org/blender/blender/pulls/146289
2025-09-15 17:22:19 +02:00
Jeroen Bakker
1dedbe3f9a Fix: Vulkan: VMA validation errors
Fixes several validation errors when using VMA.
- Always enable buffer device address in VMA as it is already a Blender
  requirement.
- Add host access hints when host access is needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/146312
2025-09-15 16:47:26 +02:00
Pablo Vazquez
4d016a7b4f UI: Geometry Nodes: Use icon for node-tree subtype
Every Node Editor sub-type selector has icons, only Geometry Nodes
was missing it.

Pull Request: https://projects.blender.org/blender/blender/pulls/146298
2025-09-15 16:29:33 +02:00
Clément Foucault
680fec144c Cleanup: GPU: Remove prefix 'e' from enum types
_No response_

Pull Request: https://projects.blender.org/blender/blender/pulls/146034
2025-09-15 15:11:02 +02:00
Sean Kim
5b02341a11 UI: Add ability to collapse paint pressure curves
This commit builds off of 5f8311f596 to support collapsing the custom
paint curve to reduce the amount of information shown to the user.

To support this, a new field is added to the `Paint` struct for this
visibility flag. This value is stored on a per-mode level, not a
per-brush level, as a user editing this curve is likely to not need
the visibility granularity on a per-brush basis.

Additionally, changes are included here to draw the curve button
itself as inactive if the parent layout it is part of is inactive.
Notably, this does not make the curve read only - it only changes
the appearance.

Pull Request: https://projects.blender.org/blender/blender/pulls/145699
2025-09-15 14:45:50 +02:00
илья _
433b61ccac Fix: CLG context is not initialized for some tests
Mesh validation log some steps even in case of valid result. And with
#132492, this validation will be part of code to create cuboid. So all
this tests will log something.

Pull Request: https://projects.blender.org/blender/blender/pulls/146234
2025-09-15 14:32:19 +02:00
Clément Foucault
b7d3b22db4 EEVEE: Move AOV clearing to its own separate pass
This splits the clearing code in a separate shader,
avoiding overhead for all material.

Testing with the same setup as #145347:
|          | main (ms) |  PR (ms) |   Delta (ms) |
| -------- | ----------- | ------------ |------------ |
| Nvidia   |         194 |  174 (1.11x) |          20 |
| Mesa AMD |         200 |  191 (1.04x) |           9 |

Pull Request: https://projects.blender.org/blender/blender/pulls/146286
2025-09-15 14:24:29 +02:00
Omar Emara
e9638b4a0a Compositor: Turn Double Edge Mask node menus into inputs
This patch turns the double edge mask node menus into two boolean
inputs.

Pull Request: https://projects.blender.org/blender/blender/pulls/146304
2025-09-15 13:45:34 +02:00
Omar Emara
3b1faf7594 Compositor: Turn menu options to sockets for pixel nodes
This patch turns node Menu options into menu inputs for Pixel nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/145596
2025-09-15 12:47:06 +02:00
Clément Foucault
bb8e987904 GPU: Simplify matrix lib to reduce dead code
This greatly reduce shader compilation time on some systems.

Pull Request: https://projects.blender.org/blender/blender/pulls/146100
2025-09-15 12:07:26 +02:00
Sean Kim
090b6efb62 Fix: Avoid potential crash when reading old blendfiles
Various runtime fields were being accessed before the runtime struct
itself was created in a newly allocated ID block. Additionally, the
call to `BKE_reports_init` is already handled by the
`WindowManagerRuntime` constructor.

Pull Request: https://projects.blender.org/blender/blender/pulls/146258
2025-09-15 11:30:52 +02:00
Bastien Montagne
678be7a703 Fix #146077: Pointers to Duplicated Scenes in Duplicated IDs are not updated.
The new duplicate copy of the scene itself was not properly set-up to
allow the usages of its source to be remapped to the new copy.

Pull Request: https://projects.blender.org/blender/blender/pulls/146177
2025-09-15 10:30:38 +02:00
Omar Emara
78e58bd595 Fix #146133: Render Layers doesn't work in viewport
The Render Layers node doesn't work if a viewlayer other than the first
is selected. This was hard coded in code, so we just allow any view
layer, on the condition that it is the active one.

Pull Request: https://projects.blender.org/blender/blender/pulls/146285
2025-09-15 10:27:14 +02:00
Bastien Montagne
92b9c4c97d I18N: Updated UI translations from git/weblate repository (db6a6b44ac5a). 2025-09-15 09:46:17 +02:00
Omar Emara
68bccbaeee Nodes: Recursively apply usage inference
This patch extends the usage_by_menu method to also consider the usage
of the menu socket in the make available and usage inference callbacks.
This essentially means that if a socket depends on menu B which, in
turn, depends on menu A, it will be sufficiently to check the value of
menu B, while A will be checked recursively.

The single variant of the usage_by_menu function is now implemented in
terms of its overloaded vector variant for code deduplication since the
new code increase the size quite a bit.

Pull Request: https://projects.blender.org/blender/blender/pulls/146141
2025-09-15 09:09:43 +02:00
Ray Molenkamp
edd2981057 CMake: Win: Properly report VS2026 when detected
Support was working already, bit we still reported it as VS2022.
This is merely a cosmetic change.
2025-09-14 10:58:45 -06:00
Habib Gahbiche
1b4daf9d2e Nodes: remove "Use Nodes" in Shader Editor for Object Materials
"Use Nodes" was removed in the compositor to simplify the compositing
workflow. This introduced a slight inconsistency with the Shader Node
Editor.

This PR removes "Use Nodes" for object materials.

For Line Style, no changes are planned (not sure how to preserve
compatibility yet).
This simplifies the state of objects; either they have a material or
they don't.

Backward compatibility:
- If Use Nodes is turned Off, new nodes are added to the node tree to
simulate the same material:
- DNA: Only `use_nodes` is marked deprecated
- Python API:
  - `material.use_nodes` is marked deprecated and will be removed in
6.0. Reading it always returns `True` and setting it has no effect.
  - `material.diffuse_color`, `material.specular` etc.. Are not used by
EEVEE anymore but are kept because they are used by Workbench.

Forward compatibility:
Always enable 'Use Nodes' when writing blend files.

Known Issues:
Some UI tests are failing on macOS

Pull Request: https://projects.blender.org/blender/blender/pulls/141278
2025-09-14 17:53:54 +02:00
Campbell Barton
62d791c8d6 Cleanup: only use "r_" prefix for return arguments 2025-09-14 23:03:01 +10:00
Campbell Barton
d1b76b6554 Cleanup: only use "r_" prefix for return arguments
Ref !146253
2025-09-14 11:08:50 +00:00
Sean Kim
a48b0abe19 Fix: Curve and Line stroke types can have incorrect spacing behavior
The intent of the Curve and Line stroke types is generally to perform
a set of equally spaced points. Unlike drawing with a tablet using the
Spacing stroke type, pressure should have no influence on this input.

Previously, the code would pass in a hardcoded value of 1.0f for the
line & curve pressure. This is incorrect, as it results in a factor of
0.5f, not 1.0f, causing behavior to differ on this stroke type depending
on if the corresponding brush pressure flag was enabled or not.

Additionally, an extra check is used to ensure that only the Spacing
stroke type can have pressure modulated in this way.

Pull Request: https://projects.blender.org/blender/blender/pulls/146120
2025-09-14 11:11:24 +02:00
Sean Kim
c6a48aecc8 Fix #146233: Dyntopo sample detail size crashes with cursor not on mesh
Introduced by 45d9bfa734

Pull Request: https://projects.blender.org/blender/blender/pulls/146249
2025-09-14 11:08:25 +02:00
Sean Kim
5892069296 Fix: Spacing doesn't work with non-default size curve
Introduced with 5f8311f596

When using the Spacing stroke type, the exact spacing between brush
daubs becomes modified by the brush size. In the case of users using
a non default brush size curve with size pressure, we need to use the
evaluated pressure factor for the size, not the raw pressure value.

Additionally, this commit renames the parameters in a helper method
to more clearly differentiate between the two float parameters.

Pull Request: https://projects.blender.org/blender/blender/pulls/146054
2025-09-14 10:11:03 +02:00
Sean Kim
1104c69a0e Fix #146153: Sculpt tools do not work after duplicating scene
Introduced with 7f3aa617ce

The `PaintMode` is needed when activating the default tool. There were
two things that caused this field on the `PaintRuntime` to be in an
invalid state on duplication:

* The original values for `PaintRuntime` were not copied to the new
  instance.
* When copying `ToolSettings`, the incorrect old value of `Paint` was
  passed to `BKE_paint_copy`, leading to the inability to copy the right
  data.

Pull Request: https://projects.blender.org/blender/blender/pulls/146199
2025-09-14 09:37:48 +02:00
Eitan Traurig
a9a54c88b9 UV: add pack to custom region option to "Pack Islands" operator
This commit implements the design task #78398

- Box region
  - Set Custom UV Region (Ctrl-B).
  - Disabled with Custom Region checkbox in the menu or (Ctrl-Alt-B).
- Box Select (Pinned) changed to (Alt-B).
- When the Custom Region enum is chosen the islands are packed
  into the bounding box of the drawn region.

Ref !140020
2025-09-14 05:23:47 +00:00
Campbell Barton
e6c0a204f6 Cleanup: use of doxygen params in doc-strings 2025-09-14 15:15:33 +10:00
Christoph Lendenfeld
ab43c57a2a Anim: fps dependent frame display in animation editors
Currently, the frame scrub area shows different frame numbers based on
the zoom level. But they would not show frame 24 until you zoom in. Since 24
is the most used frame rate for animation that's inconvenient because you never
see the spot with the full second.

With this PR the numbers and lines depend on the frame rate, and will favor
full seconds, then divide by either 2, 3 or 5 to break down the number.

This works for most FPS values, however custom FPS may hit a prime number, in which case
this logic is aborted and the next step down when zooming in will be 1. This can
result in quite large gaps where no frame numbers are displayed. But I think the impact
will be small since large prime number frame rates are rare.

This patch also reduces UI jumping because the major lines will always be turned into minor lines before disappearing.
When zooming in, any minor line will become a major line eventually.

To reduce the bunching up of minor lines when dividing by a large prime number,
they are only drawn if the distance between them is large enough.

Note that the line drawing in the VSE is not quite following the zoom level. Since this doesn't use the code path i modified in this PR I left it as is. Info from the Sequencer module is appreciated.

Pull Request: https://projects.blender.org/blender/blender/pulls/143562
2025-09-13 20:09:31 +02:00
Brecht Van Lommel
924d72e05b Fix #146192: Wrong HDR mastering display max luminance in videos
Pull Request: https://projects.blender.org/blender/blender/pulls/146217
2025-09-13 15:06:37 +02:00
Jesse Yurkovich
fde6625d8d Cleanup: Reduce size of DupliObject data
Shrink from 216 bytes to 208 by reordering the `random_id` field. Saves
32kb for every 4096 block of duplis in the DupliList container.

Pull Request: https://projects.blender.org/blender/blender/pulls/145149
2025-09-12 21:56:38 +02:00
Brecht Van Lommel
f43566f8bc Color Management: Improve handling of missing working spaces
* Fix: OpenColorIO config defined working space disappears from menu. It
  was incorrectly using the current scene linear instead of default space.
* Warn users about missing working space.
* Don't detect lin_ap0_scene working space, we don't offer it in the menu.

Pull Request: https://projects.blender.org/blender/blender/pulls/146149
2025-09-12 19:35:29 +02:00
Hans Goudey
6a8c2ca16e Fix #146139: Corrective smooth rest source property crash
Stupid mistake in a08cd68f1e.
I double checked that commit for this mistake but still missed this.
2025-09-12 12:31:53 -04:00
Damien Picard
56d52a7070 I18n: Disambiguate "Value" in colors
In some languages, a color value (as in Hue, Saturation, Value), is
not the same as a numeric or other variable value.

Pull Request: https://projects.blender.org/blender/blender/pulls/145839
2025-09-12 18:31:03 +02:00
Damien Picard
71dfbb955b I18n: Disambiguate "Bundle" in movie clip editor
Prior to 5.0, "Bundle" used to mean only the reconstructed data from
tracking.

Since then, bundles are a new data type in Geometry Nodes. It has many
occurrences, so it's easier to give it the default translation
context, and to use the "MovieClip" context for the tracking sense.
2025-09-12 18:30:56 +02:00
Damien Picard
eedc381f87 I18n: Disambiguate "Split" in the context of the sequencer
Issue reported by Joan Pujolar.
2025-09-12 18:30:56 +02:00