Commit Graph

150136 Commits

Author SHA1 Message Date
Jacques Lucke
39a3b44a72 Nodes: support searching for outputs of various input nodes directly
Previously, one had to search for the name of an input node (Geometry, Light
Path, etc.) instead of for the actual desired values.

This patch makes it possible to search for the output names of various input
nodes directly. All other outputs of the input node are hidden automatically.
This was partially support for the Scene Time before.

Supported nodes:
* Compositor: Scene Time
* Geometry Nodes: Camera Info, Mouse Position, Scene Time, Viewport Transform
* Shader Nodes: Camera Data, Curves Info, Geometry, Volume Info, Light Path,
  Object Info, Particle Info

Right now, the output names are hardcoded in the menu. We don't have a great way
to access those without an actual node instance currently. For that we'll need
to make the node declarations available in Python, which is a good project but
out of scope for this this feature. It also does not seem too bad to have more
explicit control over what's shown in the search.

Pull Request: https://projects.blender.org/blender/blender/pulls/139477
2025-05-28 05:41:37 +02:00
Mattias Fredriksson
92d83e136a Curves: Unit tests for curves::nurbs::calculate_knots
Unit tests veryfying expectation for curves::nurbs::calculate_knots.
While useful to avoid regressions, they might be more valuable as
reference of the output from the knot vector generator for different
options.

Pull Request: https://projects.blender.org/blender/blender/pulls/139508
2025-05-28 04:27:34 +02:00
Jacques Lucke
e950d4f24d Nodes: improve usage inferencing when some inputs are unknown
Function nodes can be evaluated when determining which inputs are used. However,
for general function nodes the output value is considered to be unknown if any
of the inputs is considered to be unknown. For some built-in nodes we can do
better than that.

This patch improves the behavior for the following cases, previously the output
was always unknown:
* Float Math:
  * `0.0 * x = 0.0`
  * `x * 0.0 = 0.0`
* Integer Math:
  * `0 * x = 0`
  * `x * 0 = 0`
* Boolean Math:
  * `false AND x = false`
  * `x AND false = false`
  * `true OR x  = true`
  * `x OR true = true`
  * `false NAND x = true`
  * `x NAND false = true`
  * `true NOR x = false`
  * `x NOR true = false`
  * `false IMPLY x = true`
  * `x IMPLY true = true`
  * `false NIMPLY x = false`
  * `x NIMPLY true = false`

This helps the inferencing code to be smarter on some cases.

This partially solves #139319. Although in the provided file even more complex
reasoning is necessary to fully support it. For integers it would need to keep
track of the current possible values e.g. `{0, 1}` so that when the integer is
compared to 2, it can be determined that this will always be false. This kind of
inferencing is a bit out of reach for the time being, it's not impossible
though.

Pull Request: https://projects.blender.org/blender/blender/pulls/139331
2025-05-28 04:15:33 +02:00
Hans Goudey
b80f1f5322 Geometry Nodes: Socket structure type and display changes
Implementation of #127106.
This is just a visual representation of the field/single/grid
status of sockets to make the workflow more intuitive. With
a visual representation for volume grid sockets, volume features
should be unblocked for further development. The structure type
will also be used to distinguish list sockets in the interface.

Group input nodes now have a "Structure Type" option instead of
the existing "Single Value Only". Usually the auto option should be
enough, but in some cases where the inferencing cannot (yet) make
a clear determination, it can be helpful to choose a specific type.

The new visualization and the group input structure type option
are hidden behind a new experimental option for now.

Pull Request: https://projects.blender.org/blender/blender/pulls/134811
2025-05-28 02:33:47 +02:00
Hans Goudey
e19fead49d Cleanup: Nodes: Remove always-null arguments
Pull Request: https://projects.blender.org/blender/blender/pulls/139505
2025-05-27 23:05:38 +02:00
Brecht Van Lommel
0e7a696819 Cleanup: Unused arguments in Cycles kernel
And add back the compiler flag that hid them.

Pull Request: https://projects.blender.org/blender/blender/pulls/139497
2025-05-27 21:30:45 +02:00
Brecht Van Lommel
453c2a296b UI: Make light exposure soft limits match color management exposure
In particular, holding ctrl now changes exactly one stop.

Ref #134528
2025-05-27 21:13:20 +02:00
Jeroen Bakker
425e8743fb Hydra: Add selection of Vulkan HGI
When using Vulkan HgiOpenGL was still selected. This PR changes the Hgi selectiong
to be based on the active GPU backend.

With this PR the correct Hgi could be selected, this requires the USD/Hydra libs to be
compiled with Vulkan support.

The previous implementation used `HGI_ENABLE_VULKAN` but had an issue:
- Depending on the platform the environment variable was stored inside a global
  and initialized when loading blender (even before our main entry point is triggered)
- Storm render engine in Blender has been adapted to do not do any detection.

Ref #133717

Pull Request: https://projects.blender.org/blender/blender/pulls/135780
2025-05-27 20:50:18 +02:00
Habib Gahbiche
2c271e2442 Compositor: set crop node default size to 1920x1080
The crop node default values produces an image of size 100x100. While
this is better than 0x0, it still makes the backdrop image look like it
disappeared after adding a crop node when the new image happens to be
behind a node.

Ideally, the default should be the render resolution, but we don't have
this information at node declaration time, so initialize width and
height to 1920 x 1080 such that the node has no apparent effect for the
default blend file.

<img width="216" alt="default.png" src="attachments/a904a92c-3c0c-4075-80ea-f6168bfb0966">

Pull Request: https://projects.blender.org/blender/blender/pulls/139493
2025-05-27 18:55:06 +02:00
Bastien Montagne
9af8d8af21 Cleanup: Fix comment (update reference to ID_NEW_SET macro). 2025-05-27 18:45:46 +02:00
Bastien Montagne
155e540eb7 Fix (unreported) ID copied in libs making their depencies directly linked.
Not really critical in current main, since such 'copying in library'
behavior is fairly rare, but once it start being applied to e.g.
geometry IDs owning shape keys, it would make Blender unhappy because
unlinkable IDs (the shape keys) would be tagged as directly linked.
2025-05-27 18:34:51 +02:00
Sean Kim
de454c3329 Tests: Add dyntopo brush stroke and toggle undo test
Tests that mixing dyntopo and normal mesh sculpting works as well as
manually toggling dyntopo on and off while undoing / redoing.

Pull Request: https://projects.blender.org/blender/blender/pulls/139315
2025-05-27 17:44:28 +02:00
Jacques Lucke
1a4c16a784 Geometry Nodes: initialize String node when using link-drag-search
This is similar to how Value/Vector/Integer/... nodes are automatically
initialized when they are created using link-drag-search.

Strings require some special case handling here but that seems fine. The
`node_socket_move_default_value` function is already fairly specific for the
different value nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/139478
2025-05-27 17:05:32 +02:00
Thomas Dinges
77eea32d20 Deps: Update python packages
charset-normalizer
idna
urllib3
requests
zstandard
certifi
pycodestyle

Also fix URL and package name for zstandard. (Thanks to Campbell for this).

Pull Request: https://projects.blender.org/blender/blender/pulls/139105
2025-05-27 16:26:11 +02:00
Sebastian Parborg
2f27cead09 Build: Make Zstandard use our zstd library
This makes it so that we can update to newer Zstandard versions without having to worry about zstd library version mismatches (Zstandard bundled their own zstd version)

Pull Request: https://projects.blender.org/blender/blender/pulls/138777
2025-05-27 16:21:59 +02:00
Julian Eisel
7417a07adb Fix: Weekly report script error when no PR found for branch
Not all branches have a PR and code generally handled that case fine,
just this assert didn't treat it as a valid result.
2025-05-27 15:59:37 +02:00
Jacques Lucke
43617743af Geometry Nodes: add error message when simulation is in loop or closure
This is not something we support currently. Before, the simulation would just
not do anything. Now there is an error message.

In theory, a limited version of that could be supported eventually but it does
not have high priority currently. The tricky aspect of supporting this is that
each simulation has a cache, can be baked etc and we need a persistent identify
for those. That's not possible if simulations can be added and removed
dynamically all the time.

Pull Request: https://projects.blender.org/blender/blender/pulls/139479
2025-05-27 15:03:06 +02:00
Habib Gahbiche
06d8cd74a7 Fix: compositor gizmos sometimes have no effect
After exposing options as inputs, the following gizmos may be drawn but
have no effect when tweaked:

- Sun beams
- Ellipse mask
- Box mask
- Split

This patch hides the gizmo when the relevant node inputs are linked

Pull Request: https://projects.blender.org/blender/blender/pulls/139491
2025-05-27 14:58:26 +02:00
Habib Gahbiche
5f6f5d28df Fix: Gizmo for Crop Node is broken
The wrong cursor is drawn and the gizmo is never shown.

Also fixes the warning `Gizmo .. has matrix that could not be inverted`
when using the crop node.

Pull Request: https://projects.blender.org/blender/blender/pulls/139394
2025-05-27 14:05:13 +02:00
YimingWu
16210c21e6 Fix: Win32 include error
Previous commit introduced an include which should only take
effect on windows, now put in the `#ifdef _WIN32` block
2025-05-27 19:00:30 +08:00
YimingWu
4b03d3cc21 Fix: Win32 compiling issue for readimage.cc
Needs to include "BLI_winstuff.h" for the SEH to work.

Caused by 34cd681a48
2025-05-27 18:38:27 +08:00
Omar Emara
aa657bab1d Compositor: Rename Suppress to Clamp in Glare node
This patch renames the Suppress input to Clamp, which was done after
feedback from users due to familiarity with Clamp from other places in
Blender.
2025-05-27 13:31:20 +03:00
Tom Martin
fd433a0a5c Python API: Grease Pencil: Add function set_vertex_weights on GreasePencilDrawing
This adds a new function `set_vertex_weights` to the `GreasePencilDrawing`.

Given an existing vertex group, this function writes the given weights to the
provided point indices.

Example code  for GP Stroke:
```Py
import bpy

ob = bpy.context.active_object

# Add a vertex group
ob.vertex_groups.new(name="Group")

# Get the drawing
frame = ob.data.layers.active.current_frame()
drawing = frame.drawing

# Set the vertex weights of points at index 0, 5, 10, and 15
drawing.set_vertex_weights("Group", [0, 5, 10, 15], [0.1, 0.2, 0.5, 1.0], assign_mode='ADD')
```

Pull Request: https://projects.blender.org/blender/blender/pulls/127216
2025-05-27 12:10:37 +02:00
Omar Emara
87f437eda6 Compositor: Hide value of Image Info node input
The Image Info node has no meaning when nothing is connected to the
input. So hide its value to make this more clear.
2025-05-27 11:46:50 +03:00
Anthony Roberts
32f7665673 Deps: Add support for ARM64 assembly in x264 and update FFmpeg version
It appears that previously, assembly was straight up disabled for all ARM64 platforms in x264 - this re-enables it.

This also updates the version of FFmpeg to 7.1.1. I updated the patch files so that they would cleanly apply to 7.1.1.

For Windows ARM64, it also switches both of these libraries to use the copy of LLVM we build as part of the deps, instead of MSVC - this gives a small performance increase. To do this for x264, I added a small patch taken from VCPKG - this should be harmless to other platforms.

With all these changes, I was able to get a ~20-30% perf improvement in video transcoding in the sequence editor.

Pull Request: https://projects.blender.org/blender/blender/pulls/137670
2025-05-27 10:20:48 +02:00
Anthony Roberts
b1e39d6cae Deps: Prevent OSL trying to use optix/CUDA on Windows ARM64
This was causing build issues as of #138788 (no idea why it wasn't previously)

Pull Request: https://projects.blender.org/blender/blender/pulls/139342
2025-05-27 10:10:13 +02:00
YimingWu
34cd681a48 Fix #139387: Try to handle mmap exception on Win32
`IMB_load_image_from_file_descriptor` use mmap to read images, and mmap
sometimes can have erroreous state llike accessing a file from network
drives. This patch tries to handle these exceptions like `BLI_mmap_read`
on Win32 (On unix the `sigbus_handler` will be called instead).

Pull Request: https://projects.blender.org/blender/blender/pulls/139472
2025-05-27 10:01:41 +02:00
Jeroen Bakker
5d0d54cc81 Fix #139284: Vulkan: Garbage collection not always run when rendering
During rendering when main thread is blocked or all screens are minimized the
garbage collection will not happen resulting in crashes as resources are not freed.

A better solution would be to do garbage collection in a separate thread but that requires a
ref counting system. The specifics of such a system is still unclear.

A possible solution for a Vulkan specific ref counting is to store the ref counts in the
resource tracker. That would only handle images and buffers, but it would solve the most
resource hungry issues.

Pull Request: https://projects.blender.org/blender/blender/pulls/139475
2025-05-27 09:39:54 +02:00
Omar Emara
c54e96dac3 Compositor: Use 2D/4D sockets in relevant sockets
This patch uses 2D and 4D sockets for relevant node sockets in the
compositor. This only on the UI side, internally, some of the sockets
still store 3D data, which will be handled in a later patch in the 5.0
release.

Pull Request: https://projects.blender.org/blender/blender/pulls/139452
2025-05-27 09:39:26 +02:00
Omar Emara
0dd4bba732 Fix: Typo in compositor Invert node 2025-05-27 10:15:16 +03:00
Germain-Le-Chapelain
4d4b7ab632 Cleanup: Remove redundant return statement
This if() block is unnecessary as `new_geometry()` is called anyways after that.

Signed-off-by: Germain Le Chapelain <germain.lechapelain@lanvaux.fr>
Co-authored-by: Germain Le Chapelain <germain.lechapelain@lanvaux.fr>

Pull Request: https://projects.blender.org/blender/blender/pulls/118176
2025-05-27 09:03:19 +02:00
Jacques Lucke
4f53677dcd Nodes: support searching for warning types directly 2025-05-27 09:02:06 +02:00
Campbell Barton
f9842107aa Fix #136737: Periodic freezes in edit-mode with high poly meshes
Meshes with millions of vertices could freeze when storing
edit-mode undo steps. This occurred when de-duplicating boolean arrays
(typically selection & hidden data).

This problem occurred after v3.3 because vert/edge/face flags were
moved into their own boolean custom-data layers.

Resolve using run-length encoding, used to encode all boolean
custom-data layers before adding them to the BArrayStore.

The overall speedup depends on the order of elements in the mesh
as well as the previous state of the mesh used for comparison.

Testing box selection with subdivided cubes (3.9 million vertices)
shows a speedup from an around between 8..16 seconds to ~0.025 seconds.

Even though this ran in a background thread, adding undo steps
waits for the previous step to finish which could freeze.

Tweaks to BLI_array_store such as increasing the block-size used by
edit-mesh undo and increasing length of hashed data helped but didn't
resolve the issue, see: !138975.

See code-comments for details.
2025-05-27 15:48:53 +10:00
Campbell Barton
79eea8208d BLI_array_store: support run-length encoding / decoding
Add RLE encoding/decoding functions for byte arrays for the purpose
of pre-processing arrays with large spans of (mostly) uniform values
before storing them in a BArrayState.

Part of a fix for #136737.
2025-05-27 15:48:53 +10:00
Harley Acheson
389b26d317 Fix #139393: Show Knife Tool Shortcut on Edit Mesh Menu
The menu item for Knife tool and what is bound to the "K" differ by
some properties so it does not show the shortcut on the menu. Those
properties are all defaults, so this PR just removes those from the
keymap. Everything works as now, but it shows the shortcut.

Pull Request: https://projects.blender.org/blender/blender/pulls/139457
2025-05-27 07:17:05 +02:00
Jacques Lucke
ae6aeb3cc3 Spreadsheet: garbage collect long unavailable columns
Previously, it was possible for the number of stored columns per table to grow
unbounded. While this likely isn't a problem in practice in most cases, one can
imagine cases where people temporarily have thousands of attributes when are
then never used again. We shouldn't have to store any data for these columns
forever.

This patch adds some simple garbage collection mechanism that keeps the number
of stored unavailable columns  per spreadsheet table below a certain threshold
(50 currently). Least recently used columns are removed first.

Pull Request: https://projects.blender.org/blender/blender/pulls/139469
2025-05-27 06:29:06 +02:00
Jacques Lucke
6f83928c6b Refactor: Geometry Nodes: extract warning type to separate file
It should be possible to use this type without having to include the
entire logging system.
2025-05-27 05:50:44 +02:00
Jesse Yurkovich
0d531078c6 Tests: More coverage of USD unit and orientation export settings
When exporting without a `root_prim_path` set, the unit and orientation
settings are applied in a slightly different way. Add coverage for these
cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/139468
2025-05-27 05:39:02 +02:00
Lukas Stockner
507267393e Cleanup: Cycles: Restructure camera viewplane calculation
This started with investigating a render issue that appears to be caused by
GCC 15. From what I can tell, it was caused by
`*viewplane = (*viewplane) * bcam->zoom;`.

I'm not entirely sure what the root cause is (potentially pointer aliasing?),
but the restructured code works fine now.

Pull Request: https://projects.blender.org/blender/blender/pulls/139416
2025-05-26 22:24:20 +02:00
Jesse Yurkovich
1e18fab838 Fix #139162: Exclude invisible point instancers during USD import
It was intended that pointers instancers would be skipped if they were
marked as invisible. However, we didn't account for the case of an
instancer using the "inherits" visibility but one of its ancestors in
the hierarchy being invisible.

Now these instancers will also be excluded. This is done by checking for
purpose and visibility earlier and halting the recursive traversal as
soon as we find a prim which doesn't meet the criteria.

Pull Request: https://projects.blender.org/blender/blender/pulls/139241
2025-05-26 21:31:34 +02:00
Aras Pranckevicius
3cb52b0a01 ffmpeg: faster high-bpp/HDR video decoding
Videos that are higher bit depth than 8 bit are decoded into floating
point formats (so anything that uses 10/12 bits or HDR). Speedup:
- Multi-thread GBRA planar -> RGBA interleaved conversion.
- If video is rotated, do the rotation step while doing the above
  conversion directly, instead of a separate rotation afterwards. Cuts
  down on memory bandwidth usage.

Playing back two 1920x1080 video tracks, where both are rotated and
H.265 10 bit HDR, on my PC (Ryzen 5950X), average playback frame time
goes 47ms -> 32ms (so 21FPS -> 31FPS)

Pull Request: https://projects.blender.org/blender/blender/pulls/139439
2025-05-26 19:34:22 +02:00
Jacques Lucke
66a5469bcf Spreadsheet: support restoring temporarily unavailable data columns
Previously, columns were removed from a table in the spreadsheet if they are not
available anymore. This also meant that their position and width was lost. When
the same column became available again, it was inserted at the end.

This patch makes it so that each table also remembers the columns that are not
available currently (and flags them accordingly). This way, the position and
width can be restored once the data becomes available again.

Pull Request: https://projects.blender.org/blender/blender/pulls/139440
2025-05-26 19:16:20 +02:00
Brecht Van Lommel
68ddf4125c Build: Explicitly fetch LFS files from fallback remote
Do it in make update tight after adding the remote. For some reason the
searchall mechanism does not work reliably immediately after checkout.

Fixes part of #139328.
2025-05-26 19:09:27 +02:00
Sebastian Parborg
09766d1996 Fix: Don't update submodules that we shouldn't checkout
There were a logic error in make update where we would fetch data from
submodules when not referenced in our local git config.

Fixes part of #139328.

Pull Request: https://projects.blender.org/blender/blender/pulls/139350
2025-05-26 19:09:26 +02:00
Jeroen Bakker
6b1ef63f4d Fix: Vulkan: Swapchain validation
On selected platforms there were some validation errors. It was caused by
platforms that returned a different number of swapchain images then were
requested. In that case the semaphores can get out of sync.

Current mechanism isn't future proof as the max number of images are
statically defined.

For this change the present semaphores is also separated from the frames
to better support out of order swapchain images.

Pull Request: https://projects.blender.org/blender/blender/pulls/139446
2025-05-26 16:31:02 +02:00
Omar Emara
bab308bfa2 Compositor: Turn Blur node options to inputs
This patch turns the Blur node options to inputs.

Size is now a 2D vector and replaces the Size X and Y option. Bokeh was
renamed to Separable to reflect its actual function. Relative was
removed in favor of the newly added Relative To Pixel node workflow.

There is a slight difference in variable size blurring due to float vs
integer computations, so two tests were updated.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/139329
2025-05-26 16:18:48 +02:00
Jacques Lucke
87c011f8bb Nodes: minify value input nodes
This removes redundant labels from various input nodes like the Value, Integer
and Object node.

Design wise, this is mostly straight forward except for two aspects:
* Some input nodes some have a gizmo icon. In this case I just added the gizmo
  icon on the same row.
* The checkbox in the Boolean input node should probably still have a label, so
  I kept that.

Implementation wise this adds a new function to socket declarations that allows
us to override the draw behavior of individual sockets per node.

Pull Request: https://projects.blender.org/blender/blender/pulls/139432
2025-05-26 15:47:54 +02:00
Sebastian Parborg
790d808b71 Fix: Lint issues in make_update.py 2025-05-26 15:31:17 +02:00
Sebastian Parborg
d94aeee2dc Linux: Fetch libraries with "make update", update help arguments for make_update.py
End users that do not want the libraries can use `make update_code`

Pull Request: https://projects.blender.org/blender/blender/pulls/139353
2025-05-26 14:33:35 +02:00
Nikita Sirgienko
def65ee269 Cycles: Update hipSupportsDeviceOIDN after recent OIDN version upgrade
With OIDN extending its support for new AMD devices, Blender source
code needs to be updated accordingly to reflect these OIDN changes
in the hipSupportsDeviceOIDN function. This function represents
OIDN support on AMD, allowing Blender to know this information
beforehand and avoid unnecessary errors due to attempt to denoise
on unsupported devices, as it was before the introduction of
the hipSupportsDeviceOIDN function.

Pull Request: https://projects.blender.org/blender/blender/pulls/139413
2025-05-26 13:38:15 +02:00