Commit Graph

153347 Commits

Author SHA1 Message Date
Harley Acheson
2dd420d40d BLF: Public Function to Return Maximum Glyph Bounds
This BLF adds a public function that returns the maximum extext of a
font's glyphs. BLF_bounds_max returns a rctf of the minimum rect that
can contain any of the font's glyphs. Can be useful to know when sizing
a bitmap without knowing the final string contents.

Pull Request: https://projects.blender.org/blender/blender/pulls/145016
2025-08-26 21:31:29 +02:00
Jörg Müller
ebfad2c071 Audaspace: porting changes from upstream.
Fixes for ffmpeg 8 and bugfix of a memory leak.
2025-08-26 20:46:56 +02:00
Sybren A. Stüvel
7f4096be41 Core: treat already-existing directory as 'ok' in recursive mkdir
When creating a directory recursively (via
`BLI_file_ensure_parent_dir_exists()` or `BLI_dir_create_recursive()`,
filter out errors that indicate that the directory already exists.
This is now also covered by a unit test.

I've also removed `BLI_assert(BLI_exists(dirname) == 0);` from
`dir_create_recursive()` (the workhorse for the above-mentioned
functions), for two reasons:

- The function is only used in an "ensure this directory exist"
  context, so the directory existing should be fine, and
- the assertion doesn't guarantee that the subsequent call to
  `mkdir()` actually succeeds. Race conditions between Blender and
  other processes (potentially on other computers, when using
  networked filesystems) will make such a precondition test
  unreliable.

This is a followup of 00abaa571a.

Pull Request: https://projects.blender.org/blender/blender/pulls/145173
2025-08-26 18:30:46 +02:00
Brecht Van Lommel
6aa11a304c Paint: Store brush and palette colors in scene linear colorspace
For historical reasons these were stored in sRGB space, which caused all
kinds of complexity.

* For image painting, it now properly uses the byte buffer colorspace
  instead of assuming sRGB or display colorspace. This can be more expensive,
  so there is a fast path for sRGB buffers (and for fixed brush colors).
* Lots of code was changed to remove conversion when painting float images
  or vertex colors, and added when painting byte images.
* For non-color data, there is now no colorspace conversion between the brush
  color and image pixels, and #143642 was basically reverted because of that.

Compatibility notes:

* Backwards compatibility is not perfect, as we can not determine if the
  brush has non-color data in isolation. We always convert sRGB to linear,
  and existing brushes configured with non-color data need to be manually
  fixed.
* There is forward compatibility, the old sRGB value is still stored next
  to the scene linear value.

Pull Request: https://projects.blender.org/blender/blender/pulls/144400
2025-08-26 17:10:16 +02:00
Miguel Pozo
8adb3e758f Draw: Use ResourceHandleRange
Optimize instancing performance by syncing all instances at once.
Part of #130291

At the moment, it only works for certain Object types in Workbench and
Overlay.
Everything else follows a path similar to the previous one.

Performance on instancing heavy scenes can range from 1.5x to 3x faster
depending on hardware and platform.

Pull Request: https://projects.blender.org/blender/blender/pulls/140378
2025-08-26 17:08:47 +02:00
Clément Foucault
7e26323724 EEVEE: Remove GPencil from geometry types
The Grease pencil is taking a different direction
and will not be supported in EEVEE.

See https://devtalk.blender.org/t/2025-08-13-grease-pencil-rendering-meeting/41845
2025-08-26 15:39:25 +02:00
Clément Foucault
1f3971cae9 Revert "Cleanup: GPU: Remove unused shader library guards"
This reverts commit 05115b0f88.

Material shaders do not compile after this change
2025-08-26 15:39:13 +02:00
Clément Foucault
06ddc55846 Cleanup: GPU: Fix french spelling of Dictionary
...baguette?
2025-08-26 15:38:33 +02:00
Hans Goudey
36222be528 Cleanup: Formatting 2025-08-26 09:33:43 -04:00
Clément Foucault
05115b0f88 Cleanup: GPU: Remove unused shader library guards
Nowadays every shader uses the new include system and
there is no need for these manual double include guards.
2025-08-26 15:11:35 +02:00
Bastien Montagne
65e9b99e85 Tests: Minor update to systematic tests of numerical bpy.props-defined props. 2025-08-26 15:01:55 +02:00
Aras Pranckevicius
e6a3c97259 Cleanup: tone down ffmpeg related logging amount
Recently 1ebefb8252 changed ffmpeg related logs to go through
CLOG. However, previously things coming from ffmpeg innards
via ffmpeg_log_callback were not logged at all, unless user
has explicitly asked for --debug-ffmpeg.

Many ffmpeg internal logs are not actionable and are missing
any context, thus now producing logs like:

"Could not update timestamps for discarded samples"
"Estimating duration from bitrate, this may be inaccurate"
"Could not find codec parameters for stream 2 (Audio: none (apac / 0x63617061), 48000 Hz, 2 channels, 396 kb/s): unknown codec"
"SCAN: Frame belongs to an unexpected GOP!"
"st: 2 edit list: 1 Missing key frame while searching for timestamp: 0"

Which is not very useful. Make it so that that errors/warnings coming
from ffmpeg_log_callback are treated as "info" CLOG level.

Pull Request: https://projects.blender.org/blender/blender/pulls/145172
2025-08-26 15:01:32 +02:00
Philipp Oeser
e76454a4fb Fix #145141: Crash on "Mark Freestyle Face" operator
Caused by b20ecee555

Seems to be a simple copy-paste oversight (not actually swapping "edge"
with "face").

Pull Request: https://projects.blender.org/blender/blender/pulls/145164
2025-08-26 14:24:23 +02:00
Jeroen Bakker
f82e89183e Fix #142110: Vulkan: Only last planar probe is visible
When using multiple planar probes only the last one would
be visible. The other probes would use the world probe.

Reason is that the data of planar probes are stored in
layered textures. When updating planar probes framebuffers
are created with the correct layer attached.

Vulkan backend missed some code paths to clear a single layer
when clearing a framebuffer where the previous action had depth
write disabled. This PR adds the missing code path.

Pull Request: https://projects.blender.org/blender/blender/pulls/145170
2025-08-26 14:18:47 +02:00
Falk David
3417401f0f Cleanup: Formatting
Caused by 39990303a0.
2025-08-26 13:55:38 +02:00
Philipp Oeser
d7fa455e66 Fix #144760: Some (Input) Nodes not changeable in Properties Editor
A node would not show the "Collapse/Expand" arrows (caused by
87c011f8bb which moved the drawing code for the input nodes a new
`custom_draw_fn` callback on the socket declaration).

Related fix: 7f07124d30

So in order to resolve, make sure we have correct conditions to show the
expander and also make sure we draw the custo buttons in appropriate
places.

NOTE: not sure if there are better ways to achieve the correct UI split
alignment, since we draw with empty labels, I had to flag with
`UI_ITEM_R_SPLIT_EMPTY_NAME` in the new `custom_draw_fn` callbacks.

Pull Request: https://projects.blender.org/blender/blender/pulls/144993
2025-08-26 13:18:41 +02:00
Campbell Barton
39990303a0 Cleanup: pass "Curve" as a const reference for font evaluation
Remove a redundant `const_cast`.
2025-08-26 20:56:19 +10:00
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
Pratik Borhade
c1049652e9 Revert "Outliner: Allow right mouse select"
This reverts commit ae690c1a51.

Pull Request: https://projects.blender.org/blender/blender/pulls/145129
2025-08-26 03:44:46 +02: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
Ramon Klauck
51db471491 VSE: show shortcuts in strip animation menu
This PR makes that the user sees the shortcuts for the operators in the
strip animation menu. This is done by setting the right operator
context.

Pull Request: https://projects.blender.org/blender/blender/pulls/143210
2025-08-25 22:02:39 +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
Bastien Montagne
8bb8bff4bf Tests: bpy props: Add systematic tests for non-array types.
Fairly basic tests still, would need to be extended to check invalid
cases handling too.

Pull Request: https://projects.blender.org/blender/blender/pulls/145136
2025-08-25 18:47:37 +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
Clément Foucault
c5cd01ba96 UI: Gray out the Attribute Text option when Text Info is disabled
This avoid confusion.
Rel #145027
2025-08-25 18:04:28 +02:00
Jesse Yurkovich
8078dcddf9 Tests: Adjust rounding in USD crease value test
Mistake in a8f543f6a8 where I believed the default Python `round`
function would use at least 2 decimal places by default. In reality it
uses 0 by default.

Round to 5 places to match other places in the test suite.

Pull Request: https://projects.blender.org/blender/blender/pulls/145088
2025-08-25 17:51:32 +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