Commit Graph

119749 Commits

Author SHA1 Message Date
Jacques Lucke
fdfd1de9a8 Fix: Geometry Nodes: empty expanded menu entries in modifier
Work around an issue with expanded menus that exists for a long time
already. I briefly tried fixing it, but does not seem straight forward unfortunately
without breaking stuff.

Also see the comment in `ui_item_enum_expand_exec`.
2025-05-14 14:04:15 +02:00
Campbell Barton
2bc284975b Refactor: remove the do_history argument from UV selection functions
Storing the selection history complicated the selection functions,
especially for situations when functions were called indirectly &
multiple times.

Remove the argument in favor of explicit calls to store elements
in the selection history.

Needed to avoid even more complexity with UV sync-select: see #131642.
2025-05-14 11:48:42 +00:00
Jacques Lucke
afd760f2b7 UI: Ghost: support horizontal scrolling for 2D editors
Some mice have an additional horizontal scroll wheel. This patch adds support
for receiving such events. By default it is used to scroll 2D editors left and right.

I originally developed this because I was missing it in the spreadsheet, but it
seems to be useful in many other editors too.

It's supported on Linux (Wayland), Windows and macos.

Pull Request: https://projects.blender.org/blender/blender/pulls/138758
2025-05-14 13:33:10 +02:00
Campbell Barton
d2bd988978 Fix build error, missing reference to INT_MIN
Prefer std::numeric_limits.
2025-05-14 21:26:39 +10:00
Aras Pranckevicius
9e4c26574a VSE: new cache implementation
Rework internals of how VSE caching is done. Primarily to make all the
caching logic more understandable from development point of view, but
also has several user visible implications (more details in the PR):
- Simpler and fewer caching UI options,
- Disk cache is gone (primary reason: proxies are kinda the same thing),
- VSE cache size set in preferences is actual size used for VSE caches
  now (previously caching stopped as soon as whole Blender used that
  much memory, even if some memory usage was not about VSE at all),
- Certain scenarios of cache invalidation are faster now.

Pull Request: https://projects.blender.org/blender/blender/pulls/137926
2025-05-14 12:59:46 +02:00
Pratik Borhade
4627e0d3d0 Fix #138168: Weightpainting: Smooth Operator does not respect locked flag
`BKE_object_defgroup_subset_from_select_type` does not consider locked
status of vertex group, ends up smoothing all vgroup when `deform pose bones`
is selected.

Pull Request: https://projects.blender.org/blender/blender/pulls/138435
2025-05-14 11:42:15 +02:00
Jacques Lucke
6d9b9dd2c3 Refactor: Functions: extract user data to separate header
Previously, the `UserData` and `LocalUserData` classes were only supposed to be
used by the lazy-function system. However, they are generic enough so that they
can also be used by the multi-function system. Therefore, this patch extracts
them into a separate header that can be used in both evaluation systems.

I'm doing this in preparation for being able to pass the geometry nodes logger
to multi-functions, to be able to report errors from there.

Pull Request: https://projects.blender.org/blender/blender/pulls/138861
2025-05-14 10:54:28 +02:00
Jacques Lucke
4a50809daf Cleanup: Geometry Nodes: remove legacy type from socket item accessor
The use of legacy types is discouraged and it's easy to use the node idname in all cases here.

Pull Request: https://projects.blender.org/blender/blender/pulls/138858
2025-05-14 10:19:29 +02:00
Philipp Oeser
5a882c7628 Fix: FCurve Settings RNA paths incomplete
Fill the missing gaps by going over the action data until we find the
corresponding FCurve in Layer < Slots > Channebags > FCurves.
Channelbads have their `_path` function already, so we can piggyback on
that, just adding the proper FCurve index to the mix.

Part of #137407

Pull Request: https://projects.blender.org/blender/blender/pulls/137956
2025-05-14 09:15:44 +02:00
Campbell Barton
247d8183f8 Refactor: pass the select mode to EDBM_selectmode_set
Pass the new selection mode instead of setting the value in the
BMEditMesh, then calling set.

This makes it possible to compare with the current selection mode
(needed for UV sync select #131642).
2025-05-14 11:26:58 +10:00
Clément Foucault
5fc8d4f759 Fix: GPU: Broken tests
These tests were hitting an assert about
invalid format. They were testing for this
legacy format we don't support anymore.

# Conflicts:
#	source/blender/gpu/vulkan/tests/vk_data_conversion_test.cc
2025-05-13 19:50:49 +02:00
Hans Goudey
1e1ac2bb9b Fix: Various asserts when creating GPU vertex formats
Caused by 617858e453.

These formats should use types aligned to 4 bytes. That's generally
required by modern GPUs. Uploading with these types also avoids
automatic conversion by the Vulkan backend which is something
we're hoping to remove fully.

In the end this PR removes a bunch of code related to supporting
the older single-byte formats.

Pull Request: https://projects.blender.org/blender/blender/pulls/138836
2025-05-13 19:07:01 +02:00
Guillermo Venegas
3b1e123361 Refactor: UI: Replace uiItemS and uiItemS_ex with uiLayout::separator
This merges the public `uiItemS` and `uiItemS_ex` functions into an
object oriented API (`uiLayout::separator`), matching the python API.
This reduces the difference between the C++ API with the python version,
its also helps while converting code from python to C++ code
(or vice-versa), making it almost seamless.

Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/138826
2025-05-13 17:54:26 +02:00
Jacques Lucke
db7b5a480b Spreadsheet: make column widths editable
Currently, there are two main annoying problems with columns widths in the
spreadsheet:
* The initial column width is often too small. This is especially noticeable
  with the ID integer attribute.
* There is no way to change the column width.

This patch improves both of these aspects. The initial column width will now be
derived from the content of the spreadsheet. This initial width is then stored
in DNA to make it editable and to avoid having to recompute it on each redraw.
Furthermore, there is a new modal operator to change the width of a column.

Pull Request: https://projects.blender.org/blender/blender/pulls/138657
2025-05-13 17:47:02 +02:00
Jacques Lucke
55a831d134 Cleanup: Modifiers: rename function to draw modifier error message
The old name `modifier_panel_end` was not great because:
* There is no corresponding `*_begin`.
* It sounds more magical then it really is (it just draws the error message).
* It doesn't even have to be at the end as is sometimes the case when there are subpanels.

Pull Request: https://projects.blender.org/blender/blender/pulls/138797
2025-05-13 17:27:30 +02:00
Clément Foucault
617858e453 GPU: Unified DataFormat enum
This unifies vertex and texture data formats
into a single base enum class.

`TextureFormat` and `VertexFormat` then mask
the invalid format for their respective usage.

Having a base enum allows casting between
`TextureFormat` and `VertexFormat` possible
(needed for Buffer Textures).

It also makes it easier to write and read data
to buffers/textures as each format will have an
associated host type.

These enum is generated from MACRO expansion.
This allow to centralize all information about
the formats in one place. This avoid duplicating
the list of enums for each backend.

This only creates the new enum. Porting older enums will
be done in other PRs.

Normalized integer CPU format are missing and waiting for #130640

Rel #130632

Pull Request: https://projects.blender.org/blender/blender/pulls/138069
2025-05-13 17:08:32 +02:00
Clément Foucault
83a40ceae2 GPU: Shader Preprocess: Add support for BLI C++ vector functional swizzle
This allow to share more code between C++ and the shader
code base.

Pull Request: https://projects.blender.org/blender/blender/pulls/138820
2025-05-13 16:28:55 +02:00
Clément Foucault
90be031d6b EEVEE: Optimize Upfront specialization
Many of the upfront specialized variants
were not needed/ They are only used if
some scene render setting changes, which
we can detect upfront.

This is noticeable on OpenGL which doesn't support
specialization constant and has to do full shader
recompilation for each variants.

Pull Request: https://projects.blender.org/blender/blender/pulls/138589
2025-05-13 16:28:02 +02:00
Clément Foucault
4ab8267b7e Fix: EEVEE: Broken assert
Logic was flawed.
2025-05-13 16:19:31 +02:00
Clément Foucault
a13db5be47 Cleanup: EEVEE: Warnings tautological-constant-out-of-range-compare 2025-05-13 16:19:31 +02:00
Christoph Lendenfeld
9ee5196db7 Refactor: Remove PBONE_VISIBLE and EBONE_VISIBLE macros
No functional changes intended.

This just replaces all calls to `PBONE_VISIBLE` and `EBONE_VISIBLE`
with appropriate functions.
In the case of editbones it is just the function that the macro already contained.
For pose bones, a new function was added that mirrors what the macro had.

Using a function will make it easier to change how selection is queried in the future.

part of #138482

Pull Request: https://projects.blender.org/blender/blender/pulls/138819
2025-05-13 15:51:12 +02:00
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
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