Commit Graph

122391 Commits

Author SHA1 Message Date
Pablo Vazquez
4c2169267a UI: Widen Preferences Window
The default size of the Preferences window is often not wide enough
to fit some strings under System, Keymap, and others.

Make Preferences window slightly wider, but still a conservative width
so it doesn't cover up much of the screen at the smallest recommended
screen size (1920x1080).

See PR for details and screenshots.

Pull Request: https://projects.blender.org/blender/blender/pulls/144497
2025-08-15 18:01:20 +02:00
Aras Pranckevicius
e5cc7ce59b Fix: VSE preview draw was not caching the OCIO GPU shader
IMB_colormanagement_setup_glsl_draw_to_scene_linear (only used by
VSE preview rendering) inside GPUShaderBinder::to_scene_linear_bind
was trying to cache the created OCIO GPU shader, but failed to actually
do it: it was querying scene_linear_cache, but putting the shader
into display_cache.

This lack of caching was costing around 1ms on each VSE preview draw.

Pull Request: https://projects.blender.org/blender/blender/pulls/144617
2025-08-15 15:15:08 +02:00
Clément Foucault
3c3f21ec00 GPU: Shader: Replace template macro implementation by copy paste
Use the lately introduced parser for that.

This allows to use preprocessor directive inside them.
By extension, it alows having resource accessors inside
templates.
Also error report is less confusing on most shader compilers.

The counterpart is that the shader files that are shipped
with blender are inflated.

Pull Request: https://projects.blender.org/blender/blender/pulls/144588
2025-08-15 15:13:54 +02:00
Oxicid
b1d9a91647 FBX: Add material name collision mode
Introduces the Material Name Collision option, similar to how
USD / OBJ importers have it.

Pull Request: https://projects.blender.org/blender/blender/pulls/144375
2025-08-15 15:04:36 +02:00
Thomas Hope
da46eed108 IO: Add Apply Transforms option to obj exporter
When enabled (default), exported OBJ files have the object transform
applied to their vertices. This is the previous default behaviour.

When disabled, exported vertices use their local object coordinates.

Pull Request: https://projects.blender.org/blender/blender/pulls/139436
2025-08-15 15:03:44 +02:00
Aras Pranckevicius
e8f1c6ee4d Fix: VSE cache limits not handled properly when there's way more final frames than source images
Not a common scenario, but if you had very few source images (e.g.
long image strips with one frame) and many final frames cached,
the full cache eviction policy was not handling that well, since it
was always removing at least one source image for each final frame.
Resulting in effectively the cache only being full of final frames.

Change that so:
1) evict_caches_if_full has a loop that tries to evict until the caches
  are not full (i.e. not necessarily just one image), and
2) only evict source image per final frame, if there are more source
  images cached.

Pull Request: https://projects.blender.org/blender/blender/pulls/144612
2025-08-15 12:48:11 +02:00
Casey Bianco-Davis
18da9cc777 Fix #142644: Grease Pencil: Subdivide Modifier not smoothing first point when cyclical
The problem was that the `Subdivide Modifier` would not apply catmull clark
smoothing to the first and last points when a curve was cyclical.

This also fixes a mistake were the smoothing would read from the same data
as writing, leading to the shape to be skewed.

Pull Request: https://projects.blender.org/blender/blender/pulls/144529
2025-08-15 12:19:41 +02:00
Jeroen Bakker
731d257cf4 Fix #144542: Workbench DoF crash when using Vulkan
The depth of field shader create info contained a resource that wasn't
used in the shader or fulfilled. In the Vulkan backend the shader resource
list is used in the outer loop to find out which resources needs to be
requested. As this resource didn't exist it asserted in the Vulkan backend
for incorrect usage.

Pull Request: https://projects.blender.org/blender/blender/pulls/144606
2025-08-15 11:50:38 +02:00
Jeroen Bakker
ea633b930f Fix #143989: Vulkan: Text drawing performance
Text drawing can be improved. At this moment a vertex buffer is
allocated for 2048 chars. When drawing a string the vertex buffer is
filled from the beginning with the string to draw. The next string will
replace the chars of the previous string. This locks up GPUs as the data
can only be overwritten when the buffer isn't used anymore.

Vulkan backend had an issue that uploading the new data would always
send over 2048 chars even when some chars were only used. By fixing this
the scene in the report went from 0.6 fps to 2.6 fps. OpenGL is 6 fps as
vulkan has to manage a rendergraph with 100.000 of nodes.

Text drawing performance can be improved by continue using the space of
the vertex buffers. In this case more drawing calls can be done, before
the vertex buffer needs to be updated.

Pull Request: https://projects.blender.org/blender/blender/pulls/144604
2025-08-15 10:36:27 +02:00
Julian Eisel
17f1c055da WM: Add message type for remote downloader messages to message bus
We plan on using this for online assets (see blender/blender!130543), to
send status updates with a URL to identify the online library remote.
In future this can be expanded for multiple kinds of messages with
differing data, like progress reports, sub-resource download messages
(e.g. individual assets), etc.

While this will only be used for online assets for the start, I imagine
we'd want these same kind of status messages for other remote
resources. Hence the name `WM_MSG_TYPE_REMOTE_IO`.

Pull Request: https://projects.blender.org/blender/blender/pulls/144567
2025-08-15 10:30:33 +02:00
Jeroen Bakker
1f1098c498 Vulkan: Remove MoltenVK
Blender had some support for using MoltenVK. However there are some key
issues why MotlenVK cannot be used. Bugs have been reported up-stream.
As it doesn't work and holds back regular developments it will be removed
from the main branch.

Any efforts on making Vulkan run on Apple (including KosmicKrisp)
is considered a community effort and can be done in a development
branch.

Pull Request: https://projects.blender.org/blender/blender/pulls/144602
2025-08-15 09:36:38 +02:00
Ramon Klauck
d388b807a3 VSE: Clear Strip Keyframes from Preview
This PR makes it easier to clear keyframes from strips in preview.
It is the similar to the feature in 3D viewport. Just navigate to
"Strip" -> "Animation" -> "Clear Keyframes...". This then deletes
all keyframes form the selected strips.

Pull Request: https://projects.blender.org/blender/blender/pulls/141106
2025-08-15 05:37:39 +02:00
Richard Antalik
bd4a7ef577 Fix #144332: VSE solo preview does not work
`render_give_ibuf_direct()` just called `seq_render_strip()`, which
tried to get image from intra frame cache. This always succeeded,
because the intra frame cache does not accept timeline frame argument.

Using intra frame cache here is incorrect. Source cache must be used.
If source cache lookup fails, intra frame cache must be invalidated
before calling `seq_render_strip()`.

Pull Request: https://projects.blender.org/blender/blender/pulls/144396
2025-08-15 03:44:38 +02:00
Hans Goudey
814d04aaf9 Attributes: Reset various runtime data for writing files
These fields are always reset at runtime. Writing zeros should be easier
to compress since a lot of other data is zeroed, and it also makes it
easier for developers to filter out noise when looking at data buffers.

Pull Request: https://projects.blender.org/blender/blender/pulls/144582
2025-08-14 23:39:16 +02:00
Sean Kim
3846f0e0b0 Cleanup: Rename and add comment for RadialControl#initial_mouse
Attempt to clarify that this value is not the raw initial event so that
usage is more clear during operator processing.

Pull Request: https://projects.blender.org/blender/blender/pulls/144519
2025-08-14 21:13:40 +02:00
Clément Foucault
13d25a5cfc GPU: Shader: Fix parser not being consistent
Using `std::sort` does not garantee the initial
order is kept for items with the same ranking value.

Using `std::stable_sort` fixes the issue.
2025-08-14 20:43:25 +02:00
Julian Eisel
ea9e390f69 Cleanup: Improve & correct comment for asset system file flag 2025-08-14 18:18:47 +02:00
Bastien Montagne
45fadf8297 UI: Prevent 'liboverride' 'decorator' button to control keyframes.
AFAIR, originally the decorator widget was supposed to be also usable to
control overrides.

However, this was never finished (even design wise, not sure how this would
have worked and not conflicted with the animation part of it).

So for now, apply the same behavior as with driven properties: when a
property is liboverridden (but not animated), do not allow to define or
remove keyframes.

This commit also refactors the handling of decorator action, to
deduplicate the logic deciding whether a decorators is 'active' and can
control keyframes, or not.

Pull Request: https://projects.blender.org/blender/blender/pulls/140872
2025-08-14 18:09:38 +02:00
Bastien Montagne
1e2f16c4aa UI: Remove liboverride UI dead code, improve UI messages.
The various operations of liboverride have never been effectively
exposed, remove them from the UI code at least.

Also rename related operator and UI messages to use the typical `Add`
naming (`Add Override` etc.).
2025-08-14 18:09:37 +02:00
Falk David
d50c0b7942 Cleanup: Fix compiler warning
This was caused by 8c3e81bd9b.
2025-08-14 18:08:20 +02:00
Bastien Montagne
6db4f0eb7d Fix unused warning in release builds. 2025-08-14 18:02:57 +02:00
Christoph Lendenfeld
bc93123461 Refactor: Use function overload for bone_is_visible
No functional changes intended.

This brings `bone_is_visible` in line with `bone_is_selected`,
by using function overloading instead of suffixing with either
`pchan` or `editbone`.

Pull Request: https://projects.blender.org/blender/blender/pulls/144558
2025-08-14 14:50:28 +02:00
Pratik Borhade
46ed83c386 Cleanup: Use event parameter
Mistake in a559fb833c after moving code from exec to invoke callback

Pull Request: https://projects.blender.org/blender/blender/pulls/144549
2025-08-14 14:45:38 +02:00
Casey Bianco-Davis
b056d3c85c Grease Pencil: Export other curve types to SVG
This adds support for bézier, NURBS and catmull rom curve
types in SVG exporting.

Note: strokes without uniform width will still be exported as
polylines. This is because the outline code currently does not
support bézier curves.

Pull Request: https://projects.blender.org/blender/blender/pulls/141594
2025-08-14 13:51:27 +02:00
Casey Bianco-Davis
8c3e81bd9b Fix: Grease Pencil: SVG and PDF bounding box size bug
Some times when exporting, the bounding box would have a size of zero.
This made it so that no points were visible.

This PR fixes the bounding size by using the already existing
`ed::greasepencil::retrieve_visible_strokes` function.

Pull Request: https://projects.blender.org/blender/blender/pulls/144516
2025-08-14 13:46:33 +02:00
Jeroen Bakker
7286885789 Vulkan: Update VMA to 3.3.0
Updated to latest release. Has some fixes and a new API for easy
integration with Volk.

Pull Request: https://projects.blender.org/blender/blender/pulls/144434
2025-08-14 13:20:45 +02:00
Bastien Montagne
1adb07200c Fix (unreported) assert issue in memfile undo code.
Embedded IDs never get tagged as 'unchanged', since this status is
always the same as for their owner ID.

So far, this assert was never reached, which would indicate that IDs
using embedded data are never detected as unchanged. Hopefully work like
the 'pointer stability' on blendfile writing (!127729) will improve this
situation.

The problem was triggered in upcoming packed data code, where packed IDs
are managed like regular local ones on memfile undo (and not like
regular linked ones). But in that case it looks like packed materials
and such are properly detected as unchanged...
2025-08-14 13:09:25 +02:00
Casey Bianco-Davis
44a2708c0e Fix #139094: Grease Pencil: Primitive Tools not initializing u_scale attribute
The `Primitive Tools` would not initializes the `u_scale` attribute,
making it so that the attribute would default to `0.0f` when new
strokes were drawn the the draw tool.

Pull Request: https://projects.blender.org/blender/blender/pulls/144524
2025-08-14 12:29:20 +02:00
Casey Bianco-Davis
fd7bb7f9c3 Fix: Grease Pencil: Bézier handles not effected by Snap To Grid
This makes it so that bézier handles will be snapped to the grid,
same as the control points.

Pull Request: https://projects.blender.org/blender/blender/pulls/144517
2025-08-14 12:27:21 +02:00
Casey Bianco-Davis
baaa180ba1 Fix #131108: Reproject Strokes Operator does not project bézier handles
This makes it so that bézier handles are projected correctly when
using the `Reproject Strokes` operator.

Pull Request: https://projects.blender.org/blender/blender/pulls/144518
2025-08-14 12:20:08 +02:00
Jeroen Bakker
7d384b4a01 Fix #143691: Out of bounds 2d painting
When doing 2D image painting the region on the GPU that is updated could
be out of bounds of the texture, resulting in a crash. This PR fixes
this by clamping the gpu region to update to the actual image size.

Pull Request: https://projects.blender.org/blender/blender/pulls/144545
2025-08-14 10:55:26 +02:00
Campbell Barton
5540b9440a CLI: move VSync from an environment variable to an argument
Add a command line argument --gpu-vsync on/off/auto.

Prefer command line arguments for GPU settings,
as it means the value is error checked and set when Blender starts.

Also refactor GHOST_Context to take a parameter argument which
includes the stereo-visual & debug arguments and includes the newly
added vsync setting. This makes it possible to add GPU context
parameters more easily in the future.

It also removes redundant parsing & setting the VSync setting for
off-screen contexts.

Changes to recent PR !143049.

Ref !144473
2025-08-14 05:16:12 +00:00
Campbell Barton
248a9653f6 Fix: exception types in last commit
Missed changing exception types & messages in
25c69382fc.
2025-08-14 13:10:30 +10:00
Campbell Barton
25c69382fc Fix: frozen mathutils Vector & Matrix types could be resized
It's important that frozen types are immutable, add a generic
check that mathutils types can be resized and check the frozen flag.

Also correct the exception types when Vector's cant be resized,
using a ValueError instead of a TypeError as the type is correct.
2025-08-14 12:56:48 +10:00
Campbell Barton
e06f9be733 Fix crash switching workspaces without an active object
Oversight in !142284.
2025-08-14 10:24:33 +10:00
Casey Bianco-Davis
64f5e3ac10 Fix: Grease Pencil: Attribute interpolate with randomization
The `Radius`, `Opacity` and `Vertex Color` attributes were not
getting interpolated when randomization was turned on.

The problem is most visible on the end tapers of strokes.

Pull Request: https://projects.blender.org/blender/blender/pulls/143878
2025-08-13 23:25:50 +02:00
Sean Kim
8b1f2dfc45 UI: Prevent automatic mode switching in certain scenarios
This commit effectively reverts 8d9bf47ba6
and reimplements the check at a more generic / higher level.

After the above commit, Sculpt Mode was unique compared to the other
modes in how visibility is handled, leading to inconsistencies in
behavior in Blender as a whole.

In general, we do not prevent visibility changes of objects no matter
the mode, from the outliner or otherwise, so preventing entry at the API
level solves the problem highlighted in the original commit at an
incorrect level.

While the above may be changed in the future, for now, keeping this
behavior consistent across different object modes is better than the
alternative, and preventing specialized workspaces from being entered
based on the visibility solves the original issue in a more coherent
way.

Pull Request: https://projects.blender.org/blender/blender/pulls/142284
2025-08-13 22:06:30 +02:00
Bastien Montagne
08a38e8439 Cleanup & Refactor: BKE_libblock_find_name API.
Simplify both `BKE_libblock_find_name_and_library` and
`BKE_libblock_find_name_and_library_filepath` by only searching for a
matching Library ID, and calling `BKE_libblock_find_name` to finalize
the search.

This factorize most of the search logic, and happens to fix a bug in
`BKE_libblock_find_name_and_library`, which would errosneously early-
return `nullptr` in case it found a name-matching local ID, when a
linked one was looked-up for.

Also added minimal documentation to these functions, especially for the
'library' part of the search parameters.

Pull Request: https://projects.blender.org/blender/blender/pulls/144505
2025-08-13 19:05:59 +02:00
Laurynas Duburas
2f274a5f61 Fix: Curves: Transformation center when single point handles are selected
Fixes transformation center when single point handles are selected.
Also converts auto  handles to aligned handles when a single point is
scaled or rotated.

Pull Request: https://projects.blender.org/blender/blender/pulls/144423
2025-08-13 18:54:43 +02:00
Brecht Van Lommel
585af15979 Fix: HDR video output does not preserve the view transform
The float buffer should be tagged with the standard untonemapped colorspace,
so that when we convert to PQ/HLG the tonemapping is preserved.

With this change:
* Using AgX highlights properly go to white.
* Using the ACES configs, we can convert EXRs to a HDR video, exactly
  matching colors with the HDR video on https://dpel.aswf.io/solemates/.

Pull Request: https://projects.blender.org/blender/blender/pulls/144493
2025-08-13 18:36:16 +02:00
Brecht Van Lommel
7b81213ee9 Refactor: Disambiguate default and standard view transform
The name "default" was used both for the default view transform to be set in
the color management settings, and the standard untonemapped view transform.

Pull Request: https://projects.blender.org/blender/blender/pulls/144493
2025-08-13 18:35:09 +02:00
Brecht Van Lommel
11d16737c8 Color Management: Recognize ACES config un-tone-mapped view
Besides "Standard" as in the Blender config, now also recognize
"Un-tone-mapped" as the default view settings to be used for cases like
the 3D viewport solid draw type.

Pull Request: https://projects.blender.org/blender/blender/pulls/144493
2025-08-13 18:35:08 +02:00
Omar Emara
6ea8860456 Fix #144411: Crash when loading EXR image with Alpha layer
The compositor crashes when attempting to read an EXR layer called Alpha
from a multi-layer EXR file. This is because Blender exposes an extra
output in the Image node called Alpha, which is not a real pass, but is
derived from the combined pass. So, this special case conflicts with an
actual pass called Alpha.

To fix this, we only consider the special case if the pass name is the
combined pass.

Pull Request: https://projects.blender.org/blender/blender/pulls/144498
2025-08-13 16:48:32 +02:00
Aras Pranckevicius
3d9155eb0a PointCache: improve performance and compression, always compress
Point Caches (used by particle system, cloth, boids etc.) are now
always compressed, uzing zstd coupled with lossless data filtering.

- This is both smaller cache files _and_ faster than the old
  "Heavy" compression mode,
- And smaller data files and same or slightly faster speed than
  using no compression at all,
- There was not much difference between compression levels once
  data filtering got added, so option to pick them was removed.
- So there's no downside to just always using the compression,
  which makes for a simpler UI.
- RNA change: removes PointCache.compression property.

More details and cache size / performance numbers in the PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/144356
2025-08-13 16:38:46 +02:00
Hans Goudey
fbdc501c50 Cleanup: Add missing "#pragma once" to header 2025-08-13 10:14:08 -04:00
Miguel Pozo
e0b281a505 Fix: GL Compilation Subprocess file locking
Prevent the cache file from being locked if the driver hangs during
validation.
2025-08-13 16:05:33 +02:00
Miguel Pozo
6cf196044e Fix: GL Compilation Subprocess race condition
Prevent the main process from writing to shared memory while the cache
file is being written to disk.
2025-08-13 16:03:42 +02:00
Jacques Lucke
c90a137a27 Nodes: wrap int in MenuValue type for menu sockets
Previously, we always just used `int` when dealing with menu values on the C++
side. It's currently the only type where we have the same base type (`int`) for
two different socket types (integer and menu sockets). This has some downsides:
* It requires special cases in some places.
* There is no function from static base type to socket type (which is useful for
  some utilities like `SocketValueVariant`).
* It implicitly allows operations on menu values that shouldn't be allowed such
  as arithmetic operations and conversions to and from other types.

This patch adds a new `MenuValue` type that is used for menu sockets in Geometry
Nodes and the (CPU) Compositor, clarifying the distinction between integer and
menu values.

Pull Request: https://projects.blender.org/blender/blender/pulls/144476
2025-08-13 15:43:37 +02:00
Bastien Montagne
09d357f878 Fix #144305: Crash adding workspace to startup file.
Code is trying to append from itself, this is not allowed (and will
assert in debug builds).

Instead, create a new copy of the matching local workspace. This
allows to keep identical behavior from user PoV, when the source
workspace is in the same blendfile.

Pull Request: https://projects.blender.org/blender/blender/pulls/144352
2025-08-13 15:34:10 +02:00
Christoph Neuhauser
1384bad2d2 GPU: Add flag for shader debug info generation
This PR proposes to add a new flag `--shader-debug-info` that enables the generation of shader debug information.

I created this PR as WIP due to the following reasons:
- Currently it only works for the Vulkan backend. I do not know if it makes sense for other backends. For example, OpenGL directly receives the GLSL code, so there no need for this might exist.
- So far `--debug-gpu-renderdoc` already turns on the following changes for GLSL shader compilation with shaderc:
```
options.SetOptimizationLevel(shaderc_optimization_level_zero);
options.SetGenerateDebugInfo();
```
- While combining optimization level zero with debug info is a sensible choice for frame debuggers like RenderDoc, my use case for creating this PR is shader profiling. In this case, one does not want compiler optimizations to be turned off. At the current point in time, the only information my profiler uses (which is unfortunately not public at this point in time) is the name of the shader. When turning on debug information, shaderc/glslang store this information in the generated SPIR-V data. Otherwise, it would be impossible for the profiler to tell the user what the name of the shader it is that is profiled.
- An alternative solution would be to rename the entry point `main` of a shader to the name of the shader. But this might be an even uglier hack, as it requires editing the source code (and the name of the shader then needs to be a valid GLSL function name).
- We should first clarify if there is interest in the Blender side in upstreaming an option like this. While I could just keep this in my local fork of Blender, there is merit in having the possibility to profile arbitrary Blender builds.

Pull Request: https://projects.blender.org/blender/blender/pulls/142986
2025-08-13 13:41:41 +02:00