Commit Graph

153830 Commits

Author SHA1 Message Date
Guillermo Venegas
ad50ee6bf6 Refactor: UI: Make layout estimate functions as virtual methods
Following the uiLayout refactor, this converts each layout estimate
function as virtuals methods, so w_ and y_ properties can become
protected. This includes missing structs for each layout type in
`uiItemType`, but without the `ui` prefix (they eventually will be
moved to the to the `blender::ui` namespace instead)

Pull Request: https://projects.blender.org/blender/blender/pulls/146049
2025-09-12 03:40:17 +02:00
Pratik Borhade
080d996501 Fix #146122: Grease Pencil: Duplicate cursor panel in draw mode
Caused by cc5d111078
Same parent panel being used for brush panel in sculpt, draw modes.
Add poll function that checks the current mode to avoid duplicate generation.

Pull Request: https://projects.blender.org/blender/blender/pulls/145916
2025-09-12 03:06:14 +02:00
Campbell Barton
134110b87f Cleanup: sort file lists 2025-09-12 10:20:40 +10:00
Campbell Barton
975f42b7b2 Cleanup: use doxygen comments to end groups 2025-09-12 10:19:56 +10:00
Casey Bianco-Davis
1dd536e24f Grease Pencil: Support Bézier and Catmull Rom for interpolation tool
This adds support for `Bézier` and `Catmull Rom` curve types to the
interpolation tool.

When interpolating between to curves of different types, a priority
system is used.
The priorities from highest for lowest are in the order
`NURB`, `Bézier`, `Catmull Rom` and `Polyline`.

The reasoning for this order is that:
- `NURBs` can be degree order 5 or greater, were as `Bézier` is only
order 4.
- `Bézier` can match the form of both `Catmull Rom` and `Polyline`, so
should be higher priority.
-  `Catmull Rom` is continuous.
- `Polyline` is the simplest and is not smooth, so it should be last.

Note: This does add some simple `NURBs` interpolation, but proper
handling is more complicated and will be save for a future PR.

Resolves: #141178, #143377, #133948 and #136087
Pull Request: https://projects.blender.org/blender/blender/pulls/145683
2025-09-12 01:59:03 +02:00
Sean Kim
a426e70bf6 Fix: Use new USER_DEVELOPER_TOOL_TEST macro where appropriate
Missed in fb91e576ca

Changes all of the non-sanitized, always available options to use the
new macro to match previous behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/146118
2025-09-12 01:42:52 +02:00
Sean Kim
fb91e576ca Preferences: Update macros for experimental feature checks
* Removes `USER_DEVELOPER_UI` conditional check for
  `USER_EXPERIMENTAL_TEST` since the options are always exposed in alpha
  builds.
* Adds `USER_DEVELOPER_TOOL_TEST` as a helper macro for developer
  options.`

Pull Request: https://projects.blender.org/blender/blender/pulls/146116
2025-09-12 00:48:28 +02:00
Sean Kim
4c2ea47aec UI: Add 'Developer Tools' section to user preferences
This PR introduces a 'Developer Tools' section of the user preferences,
enabled when the `Developer Extras` option is enabled. This menu will
not be hidden when the release cycle is no longer in alpha, allowing
developers to use this for common debug options instead of having to use
`G.debug_value` and arbitrary values.

This has the benefit of allowing for an ease of debugging in non-alpha
builds as well as being able to use multiple options that would have
been considered exclusive debug options at once.

None of the existing values bound to a specific `G.debug_value` have
been migrated yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/145215
2025-09-11 23:53:43 +02:00
quackarooni
dacae33cbe Nodes: Add missing tooltip descriptions for various nodes
Add a description for function nodes and a few geometry nodes
and a few shader nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/145772
2025-09-11 20:03:35 +02:00
Hans Goudey
a08cd68f1e Modifiers: Use implicit sharing for some bind data
Addresses #145680.

In one (relatively extreme) test file with the surface deform modifier,
memory usage goes from 14 GB to 4 GB, and an annoying freeze
from preparing an undo step after every operation is gone.

Pull Request: https://projects.blender.org/blender/blender/pulls/145705
2025-09-11 20:00:01 +02:00
Ray Molenkamp
eccb7fddb0 CMake: Win: Disable fastlink for VS2026
This option has been removed in vs2026 and will cause a build error,
disabling this option results in our default /DEBUG being used
which is equivalent to /debug:full which is the suggested
replacement
2025-09-11 11:45:25 -06:00
Habib Gahbiche
bef15f0ec1 Fix #145633: Revert "Fix #144526: Crash on exit with Video_Editing template"
The fix introduced a high severity bug where exiting Blender after
working with the GPU compositor crashes Blender. We consider #144526 to
be less severe than the newly introduced bug, hence the revert for now.

This reverts commit b2b23e3619.

Pull Request: https://projects.blender.org/blender/blender/pulls/146096
2025-09-11 18:08:52 +02:00
Pablo Vazquez
f4313c07b6 UI: VSE: Update White Balance modifier icon
The previous one could be confused with "exposure".

See PR for details and screenshots.

Design by Falk with small tweaks by me.

Pull Request: https://projects.blender.org/blender/blender/pulls/146083
2025-09-11 17:41:08 +02:00
Pablo Vazquez
f52f26d481 UI: VSE: Use correct icon for enable modifier
"Enable modifier" was using the eye icon, which usually indicates
only visibility, but this actually affects render.

Also in the future there could be other visibility toggles, like
regular modifiers.

Reviewed with Falk and Dalai in person.
2025-09-11 17:20:22 +02:00
Sergey Sharybin
963569caf4 Fix #146086: Regression: OpenSubdiv: GPU Shaders gets recompiled for each evaluation
Regression in 1e4764a9a5 which accidentally removed use of
the g_subdiv_evaluator_cache.

Pull Request: https://projects.blender.org/blender/blender/pulls/146097
2025-09-11 17:17:30 +02:00
Ray Molenkamp
d7bcf6e1f9 Win: Preliminary VS 2026 support
There is no CMake version yet that support VS2026, support is
currently limited to ninja based builds.

CMake does not know where to look for the MSVC 2026 Runtime
it copies the wrong CRT leading to startup issues, for this reason
WITH_WINDOWS_BUNDLE_CRT has been disabled for VS2026 + CMake < 4.2.0.
Builds done with VS2026 are for this reason *NOT* distributable to
end users at this point in time.

CMake 4.2.0 Is *expected* to have VS 2026 support [1]

But further testing is likely required.

Things of note:

- They stopped using the "preview" channel and have rebranded to
"Insiders" the make.bat options have been updated accordingly to
select the 2026 Insiders build, you need to pass 2026i to make.bat

- All tests seem to pass on my system

- No new warnings, pretty smooth update

[1] https://gitlab.kitware.com/cmake/cmake/-/merge_requests/11168
2025-09-11 08:48:53 -06:00
Jeroen Bakker
0c75361516 Vulkan: Add Memory Pool for External Pixel Buffers
Adds a separate memory pool for creating external pixel buffers.
Previous the memory type of images was used, but could not be
compatible.

Pull Request: https://projects.blender.org/blender/blender/pulls/146078
2025-09-11 16:19:23 +02:00
Falk David
929110db04 Fix: Remove unused "Active Modifier Outline" setting
This setting was added in 866fcd0a09
by mistake and shouldn't have been kept.
Removing it again.

Pull Request: https://projects.blender.org/blender/blender/pulls/146092
2025-09-11 16:18:31 +02:00
Jeroen Bakker
819175961b Fix#145961: Vulkan: Pixelbuffer are Never Exported
Pixel buffers will be imported by Cycles in Cuda/OneAPI/HIP
when supported. However the priority and export field is not filled correctly,
resulting in that the priority is always 1 and the buffer is never exported.

Should be backported to 4.5 as Cycles GPU interop isn't working
when using Vulkan.

Regression introduced by: !144422

Pull Request: https://projects.blender.org/blender/blender/pulls/146090
2025-09-11 16:15:14 +02:00
Brecht Van Lommel
45dca5c994 Vulkan: Enable wide gamut colors on Windows when HDR mode is off
Only use when Windows Automatic Color Management (ACM) is enabled.
That way we know Windows will automatically convert from extended sRGB
linear to the appropriate color space for the display.

When we previously tried this there were some issues, but I think it was due
to ACM being off. This has been confirmed to work on NVIDIA and AMD, and
Intel is not expected to support this (yet) for the same reasons there is no HDR.

Pull Request: https://projects.blender.org/blender/blender/pulls/146041
2025-09-11 15:44:38 +02:00
Ray Molenkamp
0bd3e7e213 Fix: Build error with BLI_virtual_array.hh
BLI_virtual_array.hh relies on the <functional> header
without including it, leading to build errors.
2025-09-11 07:30:52 -06:00
Jeroen Bakker
790033e0c3 Cleanup: Vulkan: Remove references to Renderpass and Framebuffer
VkRenderPass and VkFramebuffer are not used in Blender 5.0.

Pull Request: https://projects.blender.org/blender/blender/pulls/146082
2025-09-11 15:03:46 +02:00
Pablo Vazquez
535c25800b UI: Timeline: Improve Keying popover label
Display the active keying set name as label, and an icon to indicate
the current keyframe type.

This also adds a descripition/tooltip to the keying popover, so it's
easier to understand when the keying set name is not clear.

See PR for details and screenshots.

Pull Request: https://projects.blender.org/blender/blender/pulls/145963
2025-09-11 14:43:42 +02:00
Sergey Sharybin
a927c98d5a Fix #146042: Fix when view transform is set to non-existing color space
Some of the color space settings are not validated on load to be set to
a valid values. To deal with those cases better bake it so color management
module does not make assumption on validness of the input data.

This is an oversight in the !140729.

Pull Request: https://projects.blender.org/blender/blender/pulls/146084
2025-09-11 14:09:20 +02:00
Omar Emara
ad6892832f Render: Add start and end frames to render.render()
This patch adds two new optional arguments to the render.render()
operator, allowing the caller to use a custom frame range for animation
render.

Pull Request: https://projects.blender.org/blender/blender/pulls/146022
2025-09-11 12:47:08 +02:00
Clément Foucault
1f94af6aa4 GPU: Shader: Add support for loop unroll using macros
It is usually nice to unroll loops with a different number of
iteration based on a macro. This commit adds this functionality
to our shader preprocessor so that we don't have to manually unroll
these loops.

Pull Request: https://projects.blender.org/blender/blender/pulls/146043
2025-09-11 12:42:11 +02:00
Omar Emara
f699b34689 Fix #146057: Crash when using Convolve node with GPU
The Convolve node crashes Blender if used with GPU device and its output
is used multiple times. This is due to a use after free error, because
the convolve node ignored the reference count of the output.

To fix this, we retain the reference count of the output by stealing the
data of the GPU-side buffer, instead of overwriting the output with it.

Pull Request: https://projects.blender.org/blender/blender/pulls/146074
2025-09-11 12:18:35 +02:00
Philipp Oeser
ed547afcd2 Fix #146045: wrong modifier list in audio strips, crash when selected
8dcd01907d added Video strip modifiers for Audio strips as well, now
corrected.

Pull Request: https://projects.blender.org/blender/blender/pulls/146067
2025-09-11 11:31:14 +02:00
luz paz
355a805e68 Cleanup: Fix typos in source/blender/freestyle
Fix code comment typos. Found via codespell

Pull Request: https://projects.blender.org/blender/blender/pulls/145832
2025-09-11 11:30:49 +02:00
luz paz
072f956ce0 Cleanup: Fix typos in scripts subdirectory
Fix spellings from comment and string
Found via codespell

Pull Request: https://projects.blender.org/blender/blender/pulls/145834
2025-09-11 11:29:06 +02:00
Damien Picard
a8d366b48a Fix #141142: UI: Emboss status not restored in uiLayout
When using `emboss=False` on a UI prop, if `property_split` was
enabled, all subsequent props in the same layout would also be
unembossed.

This is because of the way the emboss status was set.

When drawing a prop, the previous emboss status was stored in a
temporary variable `prev_emboss`. This status was retrieved from the
uiLayout (`this`), but restored to a `layout` uiLayout that could be
another one, because it could be reassigned in the mean while.

Instead the status should just be restored to `this`, otherwise the
layout can keep the same unembossed status for subsequent props.

Pull Request: https://projects.blender.org/blender/blender/pulls/145883
2025-09-11 11:03:10 +02:00
luz paz
62a5a29d08 Cleanup: Fix typos in source/blender/nodes
Fixes user-facing typos. Found via codespell

Pull Request: https://projects.blender.org/blender/blender/pulls/145970
2025-09-11 10:49:05 +02:00
Jeroen Bakker
6cf0658eee Vulkan: Submission timeline value
Although this doesn't lead to any different behaviour or fixes any issue
it was an oversight as this would not wait for empty render graphs to be
finished in the order of submission

Pull Request: https://projects.blender.org/blender/blender/pulls/146066
2025-09-11 10:36:38 +02:00
Jeroen Bakker
9c9757e52b Cleanup: GPUFence parameter names
Renamed incorrect naming pixbuf->fence

Pull Request: https://projects.blender.org/blender/blender/pulls/146065
2025-09-11 10:36:00 +02:00
Casey Bianco-Davis
4395053115 Fix: Curves: Pen tool virtual destructor compiler warning
The destructor needs to be set to virtual. Otherwise the base object
(`PenToolOperation`) will not be destroyed with the derived object
(`GreasePencilPenToolOperation` or `CurvesPenToolOperation`).

Pull Request: https://projects.blender.org/blender/blender/pulls/146047
2025-09-11 10:28:17 +02:00
Christoph Lendenfeld
baafbd8e95 Anim: Remove PBONE_SELECTABLE macro
This patch replaces the `PBONE_SELECTABLE` macro with functions.
There is a slight functional change in that for pose bones: the visibility
is now correctly accounted for. Before this change it would always look
at the `Bone` visibility. This is no longer the correct way to
check for that since a43359eb88
moved that to the pose bone

Part of #138482

Pull Request: https://projects.blender.org/blender/blender/pulls/145974
2025-09-11 10:00:13 +02:00
Jacques Lucke
1517aa4416 Fix #146051: incorrect parent zone compute contexts when inlining shader nodes
Border links (links going from an outer zone to an inner zone) need special
handling. When requesting the value of a linked socket from outside of the
current zone, the compute context of that parent zone has to be used.

Pull Request: https://projects.blender.org/blender/blender/pulls/146059
2025-09-11 08:02:56 +02:00
Jeroen Bakker
c50c3275be Vulkan: Acquire/release swapchain images
`GHOST_SwapWindowBuffers` doesn't fit well when using swapchains. In
that case an approach where swap chain images are acquired and released
would map better. This PR introduces `GHOST_SwapWindowBufferAcquire`
and `GHOST_SwapWindowBufferRelease` to be more in line with vulkan swap
chains.

Previous implementation would first record all GPU commands based on
the last used swap chain. In case a swapchain needed to be recreated
(window resize, move to other monitor) the recorded commands would
not match the swap chain and could lead to artifacts.

OpenGL only implements the release functions as they don't
have a mechanism to acquire a swap chain image. (Need to validate with
the Metal API how this is working and adapt is needed).

Currently when starting blender on a HDR capable display the first frame
would be based on an sRGB surface and presented on an extended RGB
(or other) surface. As these don't match the first frame could be incorrect and
also lead to UBs as another surface is expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/145728
2025-09-11 07:51:30 +02:00
Campbell Barton
9dc6a2d7f3 Cleanup: correct misleading PyArg_Parser formatting 2025-09-11 15:20:20 +10:00
Campbell Barton
62906cb6f4 Cleanup: use a boolean for BMesh::use_toolflags
Bit-fields don't have any advantage in this case, use a boolean.
2025-09-11 14:40:13 +10:00
Jacques Lucke
c3f49cd24e Shader Nodes: add Python API for inlined shader nodes
This makes the shader node inlining from #141936 available to external renderers
which use the Python API. Existing external renderer add-ons need to be updated
to get the inlined node tree from a material like below instead of using the
original node tree of the material directly.

The main contribution are these three methods: `Material.inline_shader_nodes()`,
`Light.inline_shader_nodes()` and `World.inline_shader_nodes()`.

In theory, there could be an inlining API for node trees more generally, but
some aspects of the inlining are specific to shader nodes currently. For example
the detection of output nodes and implicit input handling. Furthermore, having
the method on e.g. `Material` instead of on the node tree might be more future
proof for the case when we want to store input properties of the material on the
`Material` which are then passed into the shader node tree.

Example from API docs:
```python
import bpy

# The materials should be retrieved from the evaluated object to make sure that
# e.g. edits of Geometry Nodes are applied.
depsgraph = bpy.context.view_layer.depsgraph
ob = bpy.context.active_object
ob_eval = depsgraph.id_eval_get(ob)
material_eval = ob_eval.material_slots[0].material

# Compute the inlined shader nodes.
# Important: Do not loose the reference to this object while accessing the inlined
#   node tree. Otherwise there will be a crash due to a dangling pointer.
inline_shader_nodes = material_eval.inline_shader_nodes()

# Get the actual inlined `bpy.types.NodeTree`.
tree = inline_shader_nodes.node_tree

for node in tree.nodes:
    print(node.name)
```

Pull Request: https://projects.blender.org/blender/blender/pulls/145811
2025-09-11 06:08:30 +02:00
Sean Kim
0b19cb35b6 Cleanup: Various organizational changes for brush.cc
* Reformats comment, moves it near related code
* Adds doxygen section
* Reorganizes function order

Pull Request: https://projects.blender.org/blender/blender/pulls/146050
2025-09-11 05:01:37 +02:00
Campbell Barton
1e7587f761 Cleanup: follow our API naming conventions
Minor changes to recently added undo API call.
2025-09-11 12:59:32 +10:00
Campbell Barton
77c76ccdb8 Cleanup: sort files 2025-09-11 12:41:33 +10:00
Campbell Barton
cf807a44bd Cleanup: use view2d prefix for consistency 2025-09-11 12:13:11 +10:00
Sean Kim
e9295fad65 Sculpt: Avoid setting vertex normal to the zero vector
It is possible for the simple vertex normal calculated during Paint
BVH normal updates to have a length of 0 if the connected faces cancel
each other out. This is a generally unlikely scenario, but will almost
always lead to further corruption of the mesh with the new normal.

If we detect this case, set the vertex normal to (0, 0, 1)

Pull Request: https://projects.blender.org/blender/blender/pulls/146004
2025-09-11 01:20:10 +02:00
Sean Kim
391377c804 Fix #145932: Relax Face Set brush can corrupt mesh
Caused by NaN propagation. If a face becomes 0 area, the resulting
normal becomes a zero vector. This normal cannot be used to calculate
the distance to a plane.

To fix this case more generally, we clamp the strength to 1.0 at most
to avoid introducing scenarios where a given vertex can have a zero
vector normal.

Pull Request: https://projects.blender.org/blender/blender/pulls/145952
2025-09-10 21:45:49 +02:00
John Kiril Swenson
8279e0e95c Fix: VSE: Memory leak with slip operator
An early exit when there were no strips to slip did not have a
corresponding `MEM_delete`.
2025-09-10 21:27:32 +02:00
Casey Bianco-Davis
163dfd7a9a Fix: Grease Pencil: Assert when converting to Catmull Rom or Poly
These `BLI_assert`s could be triggered by converting curves that were
already the desired type.

`curves.is_single_type` Checks if all of the curves are the desired
type, not if all of the selected curves are the type.
So the asserts can be triggered when only the destination type curves
are selected and other curve types exist.

Pull Request: https://projects.blender.org/blender/blender/pulls/145529
2025-09-10 21:01:03 +02:00
Clément Foucault
5561b97aa0 Cleanup: Metal: Avoid MSL warning in curves interpolation shader 2025-09-10 20:26:53 +02:00