Commit Graph

122601 Commits

Author SHA1 Message Date
Habib Gahbiche
adfc8da91d Cleanup: Grammar tooltip
Pull Request: https://projects.blender.org/blender/blender/pulls/145169
2025-08-26 12:52:12 +02:00
Clément Foucault
1f2c906e2a GPU: Shader: Always mute line directives for GLSL
This is motivated by the latest changes to the preprocessor
which outputs a lot of line directives when code is
generated or unrolled.

In this case the reported line would be correct but not
correctly displayed.

Moreover the system of outputing hashes inside the
`#line` directive proved to be incompatible with some
compilers and tools (renderdoc).

This commit always comments the line directives before
compilation (solves the compatibility issue).
When error logging, we then scan the commented
directives to output the correct filename and source
line. The log line is kept untouched and will show
the correct final generated code that triggered the
error.

This also fixed the error line parsing for vulkan.

Pull Request: https://projects.blender.org/blender/blender/pulls/145096
2025-08-26 12:46:46 +02:00
Casey Bianco-Davis
f291ed4156 Fix: Grease Pencil: Use evaluated positions for the Fill tool
This PR make it so that the Fill tool will use evaluated geometry.
Allowing for regions created by `Bézier`, `NURBS` and
`Catmull Rom` to be filled.

Note that the added geometry is still of curve type `Poly`.

Pull Request: https://projects.blender.org/blender/blender/pulls/144662
2025-08-26 12:31:35 +02:00
Lukas Tönne
12f0bc7736 Fix #138388: Use grid voxel corners as value locations like OpenVDB
Blender grid rendering interprets voxel transforms in such a way that the voxel
values are located at the center of a voxel. This is inconsistent with OpenVDB
where the values are located at the lower corners for the purpose or sampling
and related algorithms.

While it is possible to offset grids when communicating with the OpenVDB
library, this is also error-prone and does not add any major advantage.
Every time a grid is passed to OpenVDB we currently have to take care to
transform by half a voxel to ensure correct sampling weights are used that match
the density displayed by the viewport rendering.

This patch changes volume grid generation, conversion, and rendering code so
that grid transforms match the corner-located values in OpenVDB.

- The volume primitive cube node aligns the grid transform with the location of
  the first value, which is now also the same as min/max bounds input of the
  node.
- Mesh<->Grid conversion does no longer require offsetting grid transform and
  mesh vertices respectively by 0.5 voxels.
- Texture space for viewport rendering is offset by half a voxel, so that it
  covers the same area as before and voxel centers remain at the same texture
  space locations.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/138449
2025-08-26 12:27:20 +02:00
Aras Pranckevicius
a52bed7786 VSE: Do Scopes on the GPU, improve their look, HDR for waveform/parade
Faster and better looking VSE scopes & "show overexposed". Waveform &
RGB Parade now can also show HDR color intensities. (Note: this is
only about VSE scopes; Image Space scopes are to be improved separately)

- Waveform, RGB Parade, Vectorscope scopes are done on the GPU now, by
  drawing points for each input pixel, and placing them according to
  scope logic. The point drawing is implemented in a compute shader,
  with a fragment shader resolve pass; this is because drawing lots of
  points in the same location is very slow on some GPUs (e.g. Apple).
  The compute shader rasterizer is several times faster on regular
  desktop GPU as well.
- If a non-default color management is needed (e.g. VSE colorspace is
  not the same as display colorspace, or a custom look transform is used
  etc. etc.), then transform the VSE preview texture into display space
  RGBA 16F texture using OCIO GPU machinery, and calculate scopes
  from that.
- The "show overexposed" (zebra) preview option is also done on the
  GPU now.
- Waveform/Parade scopes unlock zoom X/Y aspect for viewing HDR scope,
  similar to how it was done for HDR histograms recently.
- Added SEQ_preview_cache.hh that holds GPU textures of VSE preview,
  this is so that when you have a preview and several scopes, each of
  them does not have to create/upload their own GPU texture (that would
  both waste memory, and be slow).

Screenshots and performance details in the PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/144867
2025-08-26 12:25:43 +02:00
John Kiril Swenson
7bd19f7efb Fix: VSE: Various crashes when sequencer scene is not initialized
Most of these crashes happen because it is assumed that the scene will
always be present even if we have an uninitialized `Editing`, which is
no longer the case with #140271.

- Fix crash when clicking and dragging in the scrub area by checking for
  valid `sequencer_scene` in `change_frame_poll`
- Fix crashes when selecting menu items by disabling them in the UI
  until a `sequencer_scene` is present
- Fix crashes running operators from the F3 menu by changing to more
  restrictive polls that check for `sequencer_scene`
- For good measure, check before dereferencing in
  `channels_displayed_get`, `active_seqbase_get`, and `editing_get`

Pull Request: https://projects.blender.org/blender/blender/pulls/145145
2025-08-26 11:53:49 +02:00
Sergey Sharybin
30d546cdca Cleanup: Unused multires_subdiv_type in ToolSettings
Pull Request: https://projects.blender.org/blender/blender/pulls/145106
2025-08-26 11:34:00 +02:00
Christoph Lendenfeld
0c36ed91db Refactor: Remove usage of std::deque
This removes the usage of `std::deque` introduced
in a43359eb88
It turns out this implementation has issues on Windows as pointed
out by Sean Kim. Falling back to a growing vector.

Pull Request: https://projects.blender.org/blender/blender/pulls/144925
2025-08-26 11:09:37 +02:00
Sybren A. Stüvel
3016cf650d Geometry Nodes: implement file path callback for import nodes
Add geometry file import nodes support to the for-each-path logic.
This will make `bpy.data.file_path_map()` report the input files for
OBJ, PLY, etc. import nodes (and any other node that has a string
property of subtype `PROP_FILEPATH`).

Currently this only supports static file paths, so where the file path
is set as the input socket's default value. When the path is
determined via any noodle, this is ignored and the default value is
reported anyway.

This is necessary for the new version of Blender Asset Tracer, which
in turn is needed to resolve studio/flamenco#104423.

Pull Request: https://projects.blender.org/blender/blender/pulls/144874
2025-08-26 11:03:27 +02:00
Falk David
23d8b7f126 Revert "Fix: Curves: Select Alternate operator not selecting handles"
This reverts commit 4d7042a46e.
The PR got merged by accident.
2025-08-26 10:54:37 +02:00
Clément Foucault
505e4fc3ae GPU: Shader: Add support for templated struct
This does a few things:
- Add support for templated struct.
- Change parsing of template scope.
  Now all template scope `<..>` are parsed properly.
- Rework to support better match syntax.
- Avoid warning from scope guard processing. Now initialize
  the return value to zero.

Pull Request: https://projects.blender.org/blender/blender/pulls/145132
2025-08-26 10:10:43 +02:00
Jeroen Bakker
0a2c84d48d Fix #144771: Vulkan: Object outlines and workbench transparency
Workbench transparency outlines where not working. The cause was that
the incorrect texture was bound in the pipeline due to unused
attachments being removed from the pipeline.

It seems to be an error since we added render pass support. This support
has already been removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/145120
2025-08-26 10:08:08 +02:00
Sergey Sharybin
721e227ce3 Fix #145137: Regression: Multires Bake: Broken with UDIM
Make rasterization consistently work in local tile coordinates.

Also avoid memory leak when baking multiple tiles: high resolution bake
mesh has been created for every tile.

Pull Request: https://projects.blender.org/blender/blender/pulls/145163
2025-08-26 10:07:24 +02:00
Campbell Barton
0c78410ae1 Cleanup: clarify naming for CharTrans, EditFontSelBox members
Also make arguments const.
2025-08-26 17:44:13 +10:00
Campbell Barton
b465504ee2 Fix #145108: Split selection removes edges
Regression [0] (likely a copy/paste error).

[0]: 50f60dbe2d
2025-08-26 17:22:53 +10:00
Campbell Barton
b244e7ec41 Fix: invalid center calculation for 3D text cursor
Regression in [0] caused out of bounds read from `EditFont::textcurs`.

[0]: 3f10ba244a
2025-08-26 16:38:46 +10:00
Jason C. Wenger
001a2b3f4d Fix #144383: Limited dissolve creates duplicate faces
Use of BM_faces_join_pair can result in an invalid mesh with doubled
faces. [0] added an assert to identify when this could occur.

This case has been inspected, and allowing the auto-join logic in
BM_faces_join_pair() to delete the doubled face does not negatively
impact iteration or processing:

1. The eheap and eheap_table used here deal only with edges, not faces.
2. Loop iteration is unchanged.
   A conversion to use of BM_ITER_MESH_MUTABLE is not applicable because
   the iteration is done on the edge heap, not the mesh.
3. The recomputation of the face normals of each combined face still
   works properly.

Ref !144653

[0]: 702efd6846
2025-08-26 13:27:34 +10:00
Campbell Barton
4b35760354 Fix: incorrect doc-strings for bpy.props type argument 2025-08-26 02:14:31 +00:00
Campbell Barton
753b6c031b PyDoc: include keyword only parameter in doc-strings 2025-08-26 02:14:30 +00:00
Campbell Barton
3f7f475c1c Docs: correct doc-string 2025-08-26 02:14:28 +00:00
Casey Bianco-Davis
346d5b7407 Fix: Curves: Don't treat non-bezier curves as selected when handles are
The `retrieve_selected_points` function would treat points of non-bezier
curves as selected if the handles were selected. And because the
attributes `.selected_handle_left` and `.selected_handle_right` are
created initialized to true for all points. The
`retrieve_all_selected_points` would return that all points were
selected.

Only points of bezier curves should be used when getting the selection
mask for handles.

Pull Request: https://projects.blender.org/blender/blender/pulls/144824
2025-08-25 23:37:12 +02:00
Casey Bianco-Davis
899a8bcdac Fix: Grease Pencil: Select Grouped not selecting bezier 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/144894
2025-08-25 23:24:21 +02:00
Casey Bianco-Davis
4d7042a46e 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/144896
2025-08-25 23:09:46 +02:00
John Kiril Swenson
96f5bb9f05 VSE: Slip toolbar tool
This PR adds a slip tool in the toolbar with its own custom icon for
applying slips using the mouse. This is useful for e.g. tablets where a
keyboard is not handy and a button would be best to activate the
operator.

There is also a custom cursor that appears when hovering over valid,
slippable strips (and a "stop" icon when the strip cannot be slipped).

Alt may be used in order to ignore slipping connected strips when using
the tool, similar to selection logic. The slip tool only performs its
sole function of slipping and as such does not change the selection
state.

In the future, we can also add "slide" functionality to the same tool,
giving it multiple functions.

Pull Request: https://projects.blender.org/blender/blender/pulls/143513
2025-08-25 20:36:01 +02:00
Janne Nylander
0d484f368e Fix #145100: Grease Pencil Pen tool subdividing multiple strokes
The pen tool would subdivide multiple strokes because the drawing index of the closest element wasn't compared to the currently processed drawings index.

Pull Request: https://projects.blender.org/blender/blender/pulls/145102
2025-08-25 19:50:56 +02:00
Hans Goudey
f4421dfc8e Curves: Cache whether any curve is cyclic
Replacing the "cyclic offsets" cache from cfb8696a73.
That was more information than was necessary in the end.
This is implemented by de-duplicating the existing "contains"
function that's implemented twice for boolean virtual arrays.

Pull Request: https://projects.blender.org/blender/blender/pulls/144761
2025-08-25 18:22:36 +02:00
Jacques Lucke
f779640402 Nodes: further optimize socket usage inferencing for many group inputs
This is an extension of 131404a1bd. The inferencing time is now down
to 4-5ms from 24ms originally.

Further improvements are likely possible. Especially, caching the results
can be very beneficial, but cache invalidation may not be entirely trivial.
2025-08-25 17:48:09 +02:00
Jacques Lucke
131404a1bd Nodes: optimize socket usage inferencing for many group inputs
This was found to be a bottleneck in the file from #144756 which has 235
group inputs and 174 group input nodes, which leads to 40,890 sockets.
Most of those are never used, so it's wasteful to add them to the map
of input values.

The inferencing time improved from 24ms to 16ms. Can likely still be
improved more, but that's a good improvement for such a small change
already.
2025-08-25 17:21:55 +02:00
Clément Foucault
e0afb37648 Fix #144781: EEVEE: Assert fail in ShadowModule at close zoom
Caused by the `lod_level` turning negative.
Using preventive measure to avoid this faulty value
fixes the issue.
2025-08-25 17:21:37 +02:00
Clément Foucault
cffb5af2ff Fix #142381: EEVEE: Freeze playing back a certain animation
In this instance the texture loading was using another
`threaded_for` loop internally which created conflict with
the top most `threaded_for`.

Using task isolation fixes the issue.

Candidate for backporting to 4.5 LTS.

Pull Request: https://projects.blender.org/blender/blender/pulls/145124
2025-08-25 17:13:35 +02:00
Hans Goudey
166d7990ab Fix #142636: Crash with node interface that's an input and an ouput
For a brief period it was possible to create these node interface sockets
that were both inputs and outputs. Nowadays we're implementing the
row-alignment in a different way, and we expect the input and output
status to be mutually exclusive. This PR adds versioning to properly
split such sockets.

The implementation relies on the unique identifier space being
separate for the input and output sockets.

Pull Request: https://projects.blender.org/blender/blender/pulls/144807
2025-08-25 17:01:45 +02:00
Miguel Pozo
9f59a36181 Revert "GPU: Improve the do_static_compilation_ check coverage"
This reverts commit 162a24e05d.

Needs testing.
There are asserts triggering on startup.
2025-08-25 16:31:43 +02:00
Sybren A. Stüvel
00abaa571a Rendering: check return value of mkdir before using directory
When rendering to an image/video file, check whether the recursive
directory creation actually succeeded. If not, log an error and stop,
instead of trying to write the file.

This results in easier to understand error messages, and will help to
triage some (what we think are) race conditions with the Blender Studio
render farm.

Pull Request: https://projects.blender.org/blender/blender/pulls/145118
2025-08-25 16:30:40 +02:00
Jonas Holzman
aeeb771a80 Fix: UI: Hide internal "mode" property in Mesh Edit Duplicate
Hides an internal "mode" property in the Edit Mode mesh "Add Duplicate"
operator Adjust Last Operation menu. Old UI issue noticed during the
Tablet Workshop.

Pull Request: https://projects.blender.org/blender/blender/pulls/144794
2025-08-25 16:18:22 +02:00
Jacques Lucke
7e7b05a054 Fix #145113: Nodes: menu error not automatically resolving 2025-08-25 16:06:46 +02:00
Miguel Pozo
cb9116f58a Fix #145017: EEVEE: Performance regression with Drivers in Shaders
Make the optimization_delay per-pass.
Lower the optimization pass GC collect rate.

Pull Request: https://projects.blender.org/blender/blender/pulls/145114
2025-08-25 15:56:35 +02:00
Miguel Pozo
162a24e05d GPU: Improve the do_static_compilation_ check coverage
Since we use StaticShader now in many places, the check is often
bypassed.

Ensure that any compiled shader is either marked as static or as a
GPUPass.

Pull Request: https://projects.blender.org/blender/blender/pulls/144950
2025-08-25 15:55:26 +02:00
Casey Bianco-Davis
6271ae5758 Curves: Delete and Dissolve operator not work with selected handles
This makes it so that the `Delete` and `Dissolve` operators will remove any
points that have handles selected.

Part of #121574.

Pull Request: https://projects.blender.org/blender/blender/pulls/144893
2025-08-25 15:41:43 +02:00
YimingWu
e4c489e5c9 Fix #145111: Typo in armature unparenting popup UI code
In f22ea2e0ae there was an update to the
UI code in this section where there's a small typo on the variable that
caused the buttons to be put on one row. Now fixed.

Pull Request: https://projects.blender.org/blender/blender/pulls/145115
2025-08-25 15:37:19 +02:00
Sergey Sharybin
a020907844 Multires Bake: Implement vector displacement baking
Supports baking to object and tangent space.

Compatible with Cycles Vector Displacement node which has the
(tangent, normal, bitangent) convention.

The viewport situation is a bit confusing: seems that Eevee
does not handle vector displacement properly and rips all faces
apart. Cycles renders the displaced object correctly.

Not entirely happy with the UI, as displacement space does not
really belong to the Output, but so doesn't Low Resolution Mesh.
Perhaps the best would be to have a separate pass to revisit the
settings, and also make it more clear what the Low Resolution Mesh
actually does.

Pull Request: https://projects.blender.org/blender/blender/pulls/145014
2025-08-25 14:23:35 +02:00
Clément Foucault
5ed307f8aa Fix: EEVEE: Bilateral denoiser has wrong color transform
The transform used for accumulation space was not
reciprocal and could modify the input intensity.

Pull Request: https://projects.blender.org/blender/blender/pulls/144987
2025-08-25 14:06:11 +02:00
Clément Foucault
87fe13fb7b Fix: EEVEE: Avoid Valgrind issues
Running valgrind on a render test exhibit a lot of warnings
about `Conditional jump or move depends on uninitialised value(s)`.

This patch makes sure to initialize the memory to avoid
platform dependent bugs.

Pull Request: https://projects.blender.org/blender/blender/pulls/144995
2025-08-25 14:05:50 +02:00
Jacques Lucke
5c325c394a Fix #145007: don't show empty tooltip popups 2025-08-25 13:10:13 +02:00
Miguel Pozo
e0a82933ab Cleanup: Remove unused code 2025-08-25 12:43:28 +02:00
Jeroen Bakker
32a812682c Fix #144625: Vulkan: Blacklist NVIDIA 580.76.05 on Linux
This PR disables support for NVIDIA 580.76.05 drivers as it can hang
on startup with Wayland. There are reports from other applications
that this driver is faulty and NVIDIA confirmed that an updated driver
is in the making.

For now we will blacklist this specific driver on any Linux system.

Pull Request: https://projects.blender.org/blender/blender/pulls/145094
2025-08-25 12:28:16 +02:00
Falk David
1122a05cb6 VSE: Scene Selector & Scene Time Synchronization
Implements the proposed design (with some modifications) in #135058.

## Sequencer Scene

This adds a new property called `sequencer_scene` to workspaces. This scene is used
by the video sequence editors in the current workspace for their context.
This is a first step towards "detaching" the VSE from the active scene in the window.

Each sequencer timeline editor shows the sequencer scene that is being used.
By default, when no sequencer scene is selected, the timeline and preview are empty.

Pressing the "new" button will add a new scene and assign it to the sequencer
scene for the current workspace.

## Contextual Playback

Pressing `Space` (by default) for starting the animation playback is now contextual:
depending on the context (where your mouse cursor is), the scene that is played back
might be different. E.g. with a 3D Viewport and a Sequencer open, pressing "play"
in the 3D Viewport will play the _active scene_ of the window, while pressing "play"
in the sequencer will play the _sequencer scene_.

## Time & Scene Synchronization

Additionally, this adds a toggle called "Sync Active Scene".
With the property turned on, the active scene & scene time in the window will be
synced with the time & scene of the current scene strip in the sequencer.

Note that this is _not_ bi-directional. The sequencer can change the active scene
and map time, but it's not possible the other way around since it one can have
multiple strips using the same scene (+camera, and even time!).

Currently this setting is exposed in the footer of the sequencer timeline as well
as in the workspace settings.

This allows for one of the core concepts that the story tools projects aims at: Working
in a scene (e.g. in the 3D viewport) while also working with the edit
(in the sequencer timeline).

## Some technical notes

* Undoing while playback is running will now cancel playback. This is to avoid the timer,
   that points to the scene and viewlayer that are playing, to get de-synced after loading
   the memfile undo step.
* When the sequencer scene is not the same as the active scene, we ensure it has
   a depsgraph.
* Normally, when a `NC_SCENE` notifier points to a specific scene, the notifier is dropped
   if that scene doesn't match the active one in the window. We now also check that it
   doesn't match the sequencer scene in the active workspace.
* When loading older files, we need to make sure that the active workspace in a window
   uses the active scene as the sequencer scene. This is to make sure that the file opens with
   the same sequences open.
* Tool settings are stored per scene. To make sure the sequencer uses the tool settings for
   the sequencer scene, the "context.tool_settings" and `CTX_data_tool_settings` members
   are overridden in the sequence editors.

Pull Request: https://projects.blender.org/blender/blender/pulls/140271
2025-08-25 11:58:17 +02:00
Casey Bianco-Davis
ede77f72fa Grease Pencil: Join Operator leaves handles selected
This PR makes so that bezier handles are deselected when
using the `Join` operator.

Pull Request: https://projects.blender.org/blender/blender/pulls/144664
2025-08-25 11:54:05 +02:00
Sybren A. Stüvel
494b041585 Python: Improve bpy.data.user_map() argument documentation
Update the call signature in the docstring so that it is clear that the
arguments to `bpy.data.user_map()` are all optional:

```
.. method:: user_map(*, subset=None, key_types=None, value_types=None)
```

This is important for Python stubs that are generated from the
docstrings; see https://github.com/michaelgold/buildbpy/issues/3.

This change feels a bit weird, as the function behaves differently
depending on whether the arguments are there or not. For example,
`subset=None` is not actually valid, as it should be a dictionary and
the function will raise a `TypeError`. But documenting `subset=dict()`
is also incorrect, because explicitly passing that will make the
function behave differently: it reports an empty dictionary, instead of
reporting everything. The same goes for the other parameters.

A better approach (IMO) would be to either add "empty dict/set means
'everything'" logic, or to allow `None` values for these parameters so
that the documented call can actually be made.

Note that this is the case for other calls as well, such as
`bpy.data.file_path_map()`. As such, I don't want to address this in
this commit; this is just for making the docstring reflect the optional
nature of the parameters.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/144933
2025-08-25 11:53:23 +02:00
Sybren A. Stüvel
25dd9ec22a Fix #144864: UI freezes with lots of Action slots (in the Outliner) part 2
Fix an omission in my earlier fix (50876d9b26). This resolves the
situation for the "Blend File" mode, where Actions are shown both in a
flat list (which should show all slots) as well as underneath the IDs
they animate (which should only show the assigned slot).

Instead of looking at the Outliner mode, the code now uses the type of
the parent tree element. If this is an "Animation" element, a single
slot is shown. Otherwise all slots are shown.

Pull Request: https://projects.blender.org/blender/blender/pulls/145101
2025-08-25 11:31:53 +02:00
Brecht Van Lommel
0b902af22d Color Management: Add Perceptual color space in color pickers
* RGB was renamed to Linear, and is the scene linear working color space.
* Perceptual uses the color picking color space, which matches the visual color
  picking widgets, and is sRGB in the default OCIO config. But it is not the
  Display color space, because for wider gamut configs that would not cover
  the whole gamut.
* The tooltips now show the specific color space name, which can be useful
  information when using different OpenColorIO configs.
* HSV is now using the color picking space rather than linear, as this matches
  the color picking widgets and is arguably easier to control.

Ref #144400, #143494

Pull Request: https://projects.blender.org/blender/blender/pulls/144564
2025-08-25 11:26:30 +02:00