Commit Graph

150077 Commits

Author SHA1 Message Date
Josh Belanich
dc02cc1d31 Fix: Vulkan: Soundness issues for Vulkan submission fences
Fixes a few render synchronization soundness issues I discovered when investigating
why resetting the pools after the submission fence in #137305 ended up causing #137395.

1. Ensure the number of submission fences in GHOST_ContextVK is the same
   as the number of resource pools in VKThreadData. Otherwise, the
   fences might get misaligned, making it difficult to predict which
   submission a fence's signal corresponds to.

2. In swapBuffers, pass the current m_frame_data's fence and semaphores
   to the Vulkan backend callbacks, rather than the following
   m_frame_data. This fixes an observed soundness issue where the fences
   were off-by-one. Now, the backend callbacks can be sure that both the
   next frame is ready for construction (and it's resources can be
   cleaned), and will use the correctly aligned fences and semaphores
   during command buffer submission.

3. Do not recreate the m_frame_data's fences during recreateSwapchain.
   This would lead to unsoundness immediately following
   recreateSwapchain where all the fences are signaled but those frames
   might still be in flight.

Pull Request: https://projects.blender.org/blender/blender/pulls/137580
2025-05-13 15:45:46 +02:00
Aras Pranckevicius
6a0e6f5cff Fix: New FBX importer was not handling blender specific FullWeights
- Update to latest ufbx version that adds support for FullWeights
- Handle that in the same way as the Python importer did
- Add test files from ufbx test suite

Pull Request: https://projects.blender.org/blender/blender/pulls/138811
2025-05-13 15:43:08 +02:00
Philipp Oeser
fba5e2ed58 Fix #138771: VSE Non-uniform scaling strip in Preview window broken
Caused by 4a11be2656

Seems like a copy-paste (using wrong axis in `image_transform_set`)

Pull Request: https://projects.blender.org/blender/blender/pulls/138807
2025-05-13 14:41:36 +02:00
Jeroen Bakker
9a540f480c Fix: Vulkan: Store large vertex buffers inside CPU RAM.
Large vertex buffers might not fit in VideoRAM (or driver doesn't allow
it). In that case we should fall back to CPU RAM.
2025-05-13 14:15:55 +02:00
Jeroen Bakker
c5ce142302 Fix: Vulkan: Incorrect enum value
When allocating uniform buffer an incorrect enum value was passed.
Gladly both enums value were the same.
2025-05-13 14:12:11 +02:00
Hans Goudey
eaa3dd0cd3 Refactor: Remove data type from draw attribute request struct
Similar to 93be6baa9c.

It doesn't make sense to store the type as part of the request
since we upload any generic attribute, and the vertex buffer
type is just chosen depending on the attribute's type in the
geometry anyway.

The code in `mesh_cd_calc_used_gpu_layers` is unfortunately
still way too complicated to remove the custom data layer lookup,
but this gets us one step closer.

Pull Request: https://projects.blender.org/blender/blender/pulls/138791
2025-05-13 13:35:30 +02:00
Jeroen Bakker
8326285c2d Fix #138775: Vulkan: Separate discard pile for rendering
When using motion blur GPU materials and its resources can be freed when
still in use. This fix adds a workaround to store these resources
temporarily in a render discard pile. When rendering is finished (or
between frames) the resources are moved to the regular discard pile.

Pull Request: https://projects.blender.org/blender/blender/pulls/138809
2025-05-13 13:15:46 +02:00
Martin Vignali
1d21d496f2 FFmpeg: Add support for 16 bits FFV1 output
This adds 16-bit/channel option for FFV1 video codec to
output render videos with high precision

Pull Request: https://projects.blender.org/blender/blender/pulls/138624
2025-05-13 11:10:33 +02:00
Omar Emara
0cee690de3 Fix: String file path interface socket has wrong type
The string interface sockets with a file path subtype are assigned a
vector translation type, which is probably a typo in the original
implementation.

Pull Request: https://projects.blender.org/blender/blender/pulls/138803
2025-05-13 10:56:56 +02:00
Nathan Vegdahl
944f793aa2 Fix: Make various mesh properties non-animatable
There are many RNA properties on the Mesh ID that were animatable, but
likely shouldn't be. For example:

- The vertex indices of edges and faces.
- The X/Y/Z mirroring toggles (effectively tool settings).

This PR marks these properties as non-animatable. The downside of doing
this is that it reduces opportunities for pranks, such as preventing
your coworkers from being able to toggle X-mirror. But that seems like
an acceptable price to pay for keeping this from happening accidentally,
and in some cases perhaps indirectly causing more serious issues.

Note that there are many, many more erroneously animatable properties
throughout Blender. This PR narrowly addresses just those that are part
of the Mesh ID type.

Pull Request: https://projects.blender.org/blender/blender/pulls/138311
2025-05-13 10:53:55 +02:00
Jeroen Bakker
b81fcb9592 Fix #138236: Vulkan: destroyed pipeline layouts could be reused
Due to an oversight in the pipeline pool/shader, pipelines that were
invalid (as subresources where destroyed) could still be selected for
reused. This happened more often when using the compositor as it
recreates shaders a lot. It also depended on how handles are reuses by
driver implementation.

This is fixed by discarded any associated pipeline when the pipeline
layout is discarded.

Pull Request: https://projects.blender.org/blender/blender/pulls/138800
2025-05-13 09:51:02 +02:00
Philipp Oeser
e951ea250a Fix #138727: Crash translating a strip without an active strip
Caused by 12f5ce7c85

Simple NULL check to prevent accesing non-existing act_strip

Pull Request: https://projects.blender.org/blender/blender/pulls/138753
2025-05-13 09:13:28 +02:00
Martin-Vignali
ca6571383a FFmpeg: Use Gray8 when rendering black and white with Quicktime Qtrle and Png
Also be more explicit about RGB pixel format
(instead of trusting first encoder pixel format)
File have been tested with After Effects CC 2025, and load as expected.

Co-authored-by: Jokyo <jokyo@MacBook-Pro-de-Jokyo-2019.local>
Pull Request: https://projects.blender.org/blender/blender/pulls/138601
2025-05-13 08:55:26 +02:00
Jacques Lucke
c2c61ce8c5 Cleanup: Nodes: decentralize node specific rna struct generation
Instead of calling all of these functions from `RNA_def_nodetree`, call them
from their respective node callbacks. This didn't work a few months ago, because
these callbacks did not have the `brna` argument back then.

Pull Request: https://projects.blender.org/blender/blender/pulls/138798
2025-05-13 08:19:30 +02:00
Endor H
309ce182b8 Nodes: Allow dragging Group Inputs from the panel into the nodes editor
This patch adds support for creating Group Input nodes by dragging input sockets
and panels from the group interface tree-view in the side bar. This
significantly simplifies creating a Group Input node for a specific input when
there are lots of them.

These cases are supported:
* Dragging an input socket creates a Group Input node just for that socket.
* Dragging a panel without panel-toggle creates a Group Input node containing
  all sockets in the panel.
* Dragging a panel with panel-toggle creates a Group Input for the panel-toggle.
* Dragging a panel with panel-toggle while holding Ctrl creates a Group Input
  with the panel-toggle and all sockets in the panel.

This is supported in all node tree types.

Pull Request: https://projects.blender.org/blender/blender/pulls/137739
2025-05-13 07:17:48 +02:00
Jacques Lucke
23d5ae7da5 Refactor: Nodes: decentralize node storage blend read/write
Previously, whenever a node had a non-trivial storage struct, there would have
to be code for it in `node.cc`. Now there is a general callback that new node
types can use to implement their blend read/write behavior.

Some existing nodes were converted to use this decentralized method. However,
some older nodes can't use it in the same way, because the node types were
introduced before there were node idnames. It's also somewhat hard to reason
about special cases that versioning code might have for these nodes, so they
remain unchanged.

The node callback only writes the non-trivial data, while the main node storage
struct is written automatically by relying on `bNodeType::storagename`. This
simplifies the callback in many cases or makes it unnecessary for trivial types.

Some nodes have specific handling for forward-compatibility. This
forward-compatibility code is kept in `node.cc` for now, because it also affects
the main storage struct and therefore has to be changed before that struct is
written.

Pull Request: https://projects.blender.org/blender/blender/pulls/138722
2025-05-13 07:00:03 +02:00
Jacques Lucke
1d99f6e7a9 Cleanup: Geometry Nodes: simplify accessing node group input index
This is the same approach as used in the Geometry Nodes modifier.
2025-05-13 05:48:49 +02:00
Jacques Lucke
f1aebcb353 Cleanup: Geometry Nodes: extract draw context struct for node group operator
This simplifies passing all these arguments recursively when panels are supported.
2025-05-13 05:44:24 +02:00
Jacques Lucke
d81a6e4a7b Cleanup: Geometry Nodes: wrong name in node group operator
This was likely copied from the Geometry Nodes modifier.
2025-05-13 05:34:40 +02:00
Jacques Lucke
1e071603a2 Cleanup: Geometry Nodes: simplify property name escaping 2025-05-13 05:31:01 +02:00
Hans Goudey
9edd645638 Fix #138790: Crash applying empty geometry node modifier on point cloud
Copying the point cloud is basically free in the scheme of things.
Better to do that than check if the output point cloud is the same.
2025-05-12 23:25:29 -04:00
Campbell Barton
b6b43339ef Cleanup: format 2025-05-13 13:21:10 +10:00
Jason C. Wenger
ae5b83e4ef Refactor: Nodes: frame node drawing
Removes an inconsistency where sometimes `bke::node_label` is used and sometimes
`node.label` to get the frame label.

Consolidates several duplicated formulas for computing the frame layout into a
single function.

Pull Request: https://projects.blender.org/blender/blender/pulls/138035
2025-05-13 05:17:09 +02:00
Campbell Barton
d859425cb3 Cleanup: differentiate object mode viewport selection types
For local struct types "Mesh" was used for both edit-mesh and
object-modes.

- Use "MeshObject" non edit-mesh selection (vertex paint selection).
- Use "Mesh" for edit-mesh types.

This follows existing naming convention: `do_lasso_select_meshobject`
for e.g.
2025-05-13 13:08:28 +10:00
Alaska
9890ad2653 Fix: Render test failure when building without ocean sim
There was one test in the volume render test folder that made use of
the ocean sim modifier to add some detail. This lead to test failures
when building Blender without ocean sim.

To fix this issue, this commit applies the ocean sim modifier. This
means it's no longer used, but the render results are the same,
meaning there is no need to update the reference images.

Pull Request: https://projects.blender.org/blender/blender/pulls/138729
2025-05-13 05:07:58 +02:00
Alaska
1c1e2f1371 Fix: Render test failures when building without fluid modifier
When building Blender WITH_MOD_FLUID=OFF, the OpenVDB render tests
would fail as some of them make use of the WITH_MOD_FLUID features.

This commit fixes this by disabling OpenVDB render tests unless
WITH_MOD_FLUID is active.

Pull Request: https://projects.blender.org/blender/blender/pulls/138728
2025-05-13 05:07:45 +02:00
Jacques Lucke
87f0ab292f Geometry Nodes: support menu type in Menu Switch node
Previously, it was not possible to switch a menu based on another menu. This
patch adds support for this.

Usually, menu sockets are drawn without the label in nodes currently. Now there
is one exception: the Menu Switch node when it switches another menu. If the
label is not shown, the UI is missing crucial information.

Pull Request: https://projects.blender.org/blender/blender/pulls/138704
2025-05-13 04:57:19 +02:00
Jacques Lucke
61e99ca667 Geometry Nodes: improve muted behavior of switch nodes
Previously, Switch node were using the fallback behavior when they were muted.
That implied that the generated internal link was generally not very useful.
This patch makes the behavior of muted switch nodes explicit. Now the internal
link will always point to the first value input and never to the condition
input. Note, for the Menu Switch node this does not make a difference yet,
because menu sockets are not supported there yet (#138704).

Pull Request: https://projects.blender.org/blender/blender/pulls/138724
2025-05-13 04:54:54 +02:00
Campbell Barton
2f2eb6468b Cleanup: add missing break statement 2025-05-13 12:31:16 +10:00
Hans Goudey
8f5952f4c1 Cleanup: Formatting 2025-05-12 22:18:01 -04:00
Hans Goudey
f83830409e Cleanup: Remove outdated todo comment
There isn't really a reason why the sculpt and BLI
BVH trees have to have the same threading threshold.
2025-05-12 21:54:04 -04:00
Campbell Barton
7554126109 Fix: missing null check on Curve::str before freeing 2025-05-13 11:47:44 +10:00
Campbell Barton
094104651f Fix: crash if Curve::str was null when entering edit-mode
This is checked for null elsewhere, check on entering edit-mode too.
2025-05-13 11:32:23 +10:00
Campbell Barton
9deea7677f Cleanup: use doxygen doc-strings, correct file references in UI headers
Also move implementation note from doc-string into the body of the
function.
2025-05-13 11:14:27 +10:00
Campbell Barton
011de28348 Fix #138730: Crash setting 3D texts font to None
Regression in [0] caused a null pointer dereference.

[0]: 2336b7c6f8
2025-05-13 10:48:37 +10:00
Campbell Barton
64a43fff20 Fix #138652: Crash editing an ID name after undo
Regression in [0] which missed updating the old-buttons data,
causing it to reference freed Main & ID pointers after undo.

Apply the same fix for uiBut::pushed_state_func.

[0]: 3e03576b09
2025-05-13 09:48:11 +10:00
Hans Goudey
a86873f251 Cleanup: Fix custom data type categories in attribute type conversion 2025-05-12 19:28:32 -04:00
Harley Acheson
87dcf4907a UI: Add Hide to Properties NavBar Item Context Menu
Add an item to hide the NavBar to the Context Menu for the items on the
NavBar.

Pull Request: https://projects.blender.org/blender/blender/pulls/138786
2025-05-13 00:57:10 +02:00
Sean Kim
8fdaa555e8 Sculpt: Use capability check for dyntopo panel options
Prior to this commit, the Dyntopo panel was hardcoded to display as
faded if the current brush was the mask brush. This conflicts with the
common set of brushes which we do not support dyntopo for, which
includes many other brushes.

This commit changes the check to better indicate that certain brushes do
not support dyntopo. The scene-level settings can still be changed & the
detail flood fill operator remains functional even if the a different
brush is selected.

Additionally, the panel is no longer greyed out if the "Manual" option is
active.

Pull Request: https://projects.blender.org/blender/blender/pulls/138634
2025-05-12 23:19:01 +02:00
Hans Goudey
f2327a956b Cleanup: Remove disabled code
This only makes this function even more difficult to understand.
2025-05-12 16:38:14 -04:00
Guillermo Venegas
a017a6cc54 Refactor: UI: Replace uiItemO with class method uiLayout::op
This converts the public `uiItemO` function to an object oriented
API (`uiLayout::op`).
Also this rearranges `idname` paramether, since this the only one
required, and to make format similar to `uiItemFullO`

Note: One of the benefits of moving from a public function to class
method is to reduce API usage difference between C++ and Python. In
Python this method is called `UILayout::operator`, however `operator`
is a reserved keyword in C++.

Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/138776
2025-05-12 22:14:38 +02:00
Hans Goudey
93be6baa9c Refactor: Remove domain from draw attribute request struct
Similar to b21cb20eeb.
This time the domain is removed. The idea is that the domain doesn't
change anything about how the attribute is stored on the vertex buffers
so it doesn't make sense as part of the request. If we continue that
logic to also remove the data type, we can avoid searching through the
geometry when creating the requests, instead handling invalid requests
when creating the buffers.

The complexity of the change comes from the fact that the request's
domain was used to determine whether the Curves drawing code needed to
interpolate the attribute to the evaluated points. This is now stored
separately in the curves cache. The change in the sculpt code is also
non-trivial since we delay more of the logic until after we have
looked up the attribute from the geometry.

Pull Request: https://projects.blender.org/blender/blender/pulls/138619
2025-05-12 21:16:15 +02:00
Miguel Pozo
c16aba915f GPU: Add GPU_shader_batch_cancel
Fix the recently implemented ShaderCompiler::batch_cancel.
Expose it with GPU_shader_batch_cancel and
GPU_shader_specialization_batch_cancel.
Use them in the EEVEE ShaderModule destructor, to prevent blocking on
destruction when there are in-flight compilations.

Pull Request: https://projects.blender.org/blender/blender/pulls/138774
2025-05-12 19:54:03 +02:00
Miguel Pozo
ee5185b287 Fix: Workbench: Image Render AA
Regression from 66796ef9d4.
taa_finished is only true after the last sample.
2025-05-12 18:58:00 +02:00
Sergey Sharybin
3c8138cdc5 Cleanup: Unused variable warning 2025-05-12 17:54:19 +02:00
Clément Foucault
91dcea8efc Fix: UI: Invalid scissors in interface drawing
These were causing asserts on Metal.

Pull Request: https://projects.blender.org/blender/blender/pulls/138684
2025-05-12 17:49:16 +02:00
Mattias Fredriksson
d0cf7dd8b5 Fix: Improve OBJ NURBS IO, support exporting custom knots
Corrects behavior with NURBS knot values in .obj exporter. Knot values
denoting the curve parameter range and values at the boundary region
in the span ends had hardcoded knot values. It also implemented its own
knot calculation, which is not ideal...

Importer is updated to not try to second guess the knot values.
Not entirely sure what it was trying to do but it used wrong indices
and missed writing the end of the knot vector. Combined the changes
should make it possible to import and export a simple NURBS curve with
custom knots and leaving it intact.

This replaces some of the erronous behavior using functions from [new]
Curves implementation. Mixing new and legacy curve implementation is not
ideal but exporter is exporting POLY curves as NURBS while legacy method
does not support computing the knot vector. To avoid introducing
additional branch cases nor update legacy functions, using the new
functions seems to be the correct choice. These functions should be
functionally equivalent but is not identical (e.g. legacy curve returns
knots in [0, 1] range). It should also make it easier to transition to
exporting new Curves.

Pull Request: https://projects.blender.org/blender/blender/pulls/138732
2025-05-12 16:51:21 +02:00
Ray Molenkamp
bf325bc1b8 Fix: Incorrect submodule hashes in previous commit
accidentally got committed in 2c5b9e182b
2025-05-12 08:48:10 -06:00
Ray Molenkamp
2c5b9e182b CMake: Add code coverage support for clang
Pretty bare bones but gets the job done, unlike the gcc
tooling, this will work for release builds, the performance cost
of it is on the high side of things, the full test suite tests take over
an hour for me with code coverage support enabled on a release build.
I have not timed a debug build. Given developers can just run their
tests to get coverage data over what they are working on, I feel this
is still useful tooling to have.

This adds the 3 targets for clang and adds a single gcc target

coverage-reset - this removes the collected code coverage data and
report

coverage-report - This merges the collected data and generates the
report (new for gcc)

coverage-show - This merges the collected data and generates the report
and opens it in the browser

This relies on llvm-cov and llvm-profdata being available if not found
code coverage is disabled.

Note: A full test run requires an obscene amount of disk space, a
complete test run takes about 125GB and takes 12 minutes to merge, so
provision the COMPILER_CODE_COVERAGE_DATA_DIR folder accordingly

Example report in PR
2025-05-12 16:28:41 +02:00
Jacques Lucke
dd47ee9e25 Nodes: show warning when a group output is unused
There are very rare use-cases for having multiple Group Output nodes. However,
it's something that's been supported for a long time and removing it may be a
regression for some. In practice, it's usually a mistake when someone has
multiple Group Output nodes.

This patch adds a simple warning on inactive Group Output nodes to help the user
notice this case.

Pull Request: https://projects.blender.org/blender/blender/pulls/138743
2025-05-12 16:13:57 +02:00