Commit Graph

150077 Commits

Author SHA1 Message Date
Campbell Barton
4c794e8e2e Cleanup: early return in node gizmo poll functions
Avoid multiple null checks for SpaceNode, check & return early.
2025-05-20 11:50:35 +10:00
Campbell Barton
7c668c0308 Cleanup: CMake indentation & wrap long lines 2025-05-20 11:20:09 +10:00
Campbell Barton
29ab328f35 CMake: use "mode" argument for messages
While it's optional, include by convention and helps to clarify the
purpose of a message.
2025-05-20 11:15:35 +10:00
Sean Kim
f365824b40 Cleanup: Remove unused & unimplemented sculpt_paint functions
Pull Request: https://projects.blender.org/blender/blender/pulls/139123
2025-05-20 00:55:42 +02:00
Ray Molenkamp
73c751afaf Deps_builder: Win: X64: Fix msys2 setup
on a freshly installed environment diff.exe requires newer runtime
dll's. For now only fix this on X64 as on windows on arm there's
issues with newer msys2 versions (but I do now know exactly what
they are anthony has brought it up in the past) this can however
not remain in a broken state, so fixing it for X64 only.

Also fix typo in download_package function

These two fixes together should bring a fresh vmprep install back
to working order.
2025-05-19 14:43:49 -06:00
Hans Goudey
867256f4c8 Cleanup: Formatting 2025-05-19 16:13:20 -04:00
Damien Picard
81d9e94218 UI: Fix and improve a few messages
- "Parameters for custom (OSL-based) Cameras" -> "cameras": lower case
  in tooltips.
- "Connect two nodes ... (automatically determined": missing
  parenthesis.
- "Join curve... control points are detected(if disabled...": add
  missing space.
- "Add Selected to Active Objects Collection" -> "Active Object's":
  typo.
- "Duplicate the acive shape key" -> "active": typo.
- "Copy selected points ": remove trailing space.
- "Move cursor" -> "Cursor": title case for operator.
- "Paste text to clipboard" -> "from clipboard": typo.
- "An empty Action considered as both a 'layered' and a 'layered'
  Action." -> "is considered as both a 'legacy' and a 'layered'
  Action": likely copy-paste error.
- "Target's Z axis will constraint..." -> "will constrain": typo.
- "The layer groups is expanded in the UI" -> "layer group": typo.
- Deprecation warnings: add missing parentheses.
- "... on low poly geometry.Offset rays...": add missing space after
  period.
- "... relative to the files directory" -> "... to the file's
  directory": typo.
- "The unit multiplier for pixels per meter" -> "The base unit": this
  property description was copy and pasted.
- "... beyond the faces UVs..." -> "the faces' UVs: typo.
- "Is tracking data contains ..." -> "Whether the tracking data
  contains": grammar.
- "Selected text" -> "Text": title case for prop.
- "The user has been shown the "Online Access" prompt and make a
  choice" -> "made a choice": grammar.
- "Glare ": remove trailing space.
- "Don't collapse a curves" -> "Do not collapse curves": grammar.

Some issues reported by Tamar Mebonia.

Pull Request: https://projects.blender.org/blender/blender/pulls/139118
2025-05-19 22:12:17 +02:00
Ray Molenkamp
aafd3a53bd deps: vmprep: update cmake to 3.31.7 needed for USD
Also fix typo in HIP version.
2025-05-19 13:58:35 -06:00
Ray Molenkamp
ee04d69edc deps: win: shaderc: do not harvest debug libs for shaderc
While shaderc is a c++ library, its api is a C based one so
we do not need a debug version of this library, the blender
side was already updated in f2b9dd3462 this cleans up the
builder side of things.
2025-05-19 13:50:03 -06:00
Hans Goudey
550094b018 Refactor: Attributes: Access active attribute with name
This function to get the active attribute currently returns a custom
data layer pointer. This doesn't work when we transition to the new
`AttributeStorage` system. Returning an optional string is a simple
alternative that also aligns with the idea of changing the source of
truth from an index to a string stored on the geometry.

Pull Request: https://projects.blender.org/blender/blender/pulls/139115
2025-05-19 21:29:57 +02:00
Hans Goudey
b93f4f9449 Fix #139103: Spreadsheet row filters not working
Caused by db7b5a480b.
2025-05-19 14:17:56 -04:00
Hans Goudey
2bcd665659 Cleanup: Pass IndexMask by const reference 2025-05-19 14:17:56 -04:00
Bastien Montagne
bbe9eb647a Cleanup: Remove redundant usage of ID_NEW_SET in Object high-level duplication code.
This is already always done by lower-level `BKE_id_copy_for_duplicate`
(through the call to `BKE_object_duplicate`).
2025-05-19 20:16:43 +02:00
Bastien Montagne
3957b4a11f Cleanup: Improve documentation of BKE_object/collection_duplicate functions.
No functional change expected here.
2025-05-19 20:16:43 +02:00
Jesse Yurkovich
46ec277713 USD: Add support for UsdPrimvarReader_TYPE in materials
Add support for the UsdPrimvarReader_TYPE templates for both import and
export. These are used by several USD test assets and support here
represents the last major piece of the UsdPreviewSurface spec to be
implemented.

On import these become `Attribute` nodes and on export the `Attribute`
nodes will become `UsdPrimvarReader_TYPE`'s accordingly.

Import:
- `UsdPrimvarReader_float` and `UsdPrimvarReader_int` will use the `Fac`
  output
- `UsdPrimvarReader_float3` and `UsdPrimvarReader_float4` will use the
  `Color` output
- `UsdPrimvarReader_vector`, `UsdPrimvarReader_normal`, and
  `UsdPrimvarReader_point` will use the `Vector` output

Export (only `Geometry` Attribute types are considered):
- `Fac` will use `UsdPrimvarReader_float`
- `Color` will use `UsdPrimvarReader_float3`
- `Vector` will use `UsdPrimvarReader_vector`
- `Alpha` is not considered

MaterialX note:
Hydra-native support is a bit more involved and will have to be done
separately. Hydra w/USD sync is trivial to implement but those changes
have been left out here.

Pull Request: https://projects.blender.org/blender/blender/pulls/135143
2025-05-19 19:47:22 +02:00
Sean Kim
dc213cd79e Cleanup: Remove extra whitespace in some sculpt helper methods
Pull Request: https://projects.blender.org/blender/blender/pulls/139041
2025-05-19 19:41:33 +02:00
Sean Kim
8f4ac59f7c Cleanup: Tag Brush toggle_brush field as deprecated
This field's usage was removed with the brush assets project, previously
it was used during runtime in the `PAINT_OT_brush_select` operator.

This commit tags the DNA field as deprecated and marks the overall
`brush.cc` file with `#define DNA_DEPRECATED_ALLOW` to follow a similar
pattern as other BKE files dealing with I/O of ID types.

The field was added in 147b4b13ba and
updated in 7b7aba31f2 to prevent invalid
pointers from remaining on the brush.

Pull Request: https://projects.blender.org/blender/blender/pulls/138578
2025-05-19 19:40:48 +02:00
Hans Goudey
b038e35c2d Fix: Build failure without OpenVDB
Caused by 0837037d13.
2025-05-19 13:34:59 -04:00
илья _
b5dfc9ea70 Fix: Nodes: Apply unit range for Mix factor
Add soft unit range for mix factor in vector non-uniform mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/139024
2025-05-19 19:33:42 +02:00
Jacques Lucke
0837037d13 Geometry Nodes: initial support for volume grids in function nodes
This patch implements basic support for evaluating function nodes on volume
grids. Conceptually, a function node always creates a new grid for the output,
though the output is often a modified version of the input. The topology of the
output grid is a union of all the input grids.

All input grids have to have the same transform. Otherwise one has to use
resampling to make grids compatible.

Non-grid inputs are allowed to be single values or fields. The fields are
evaluated in a voxel/tile context, so they compute a value per voxel or per
tile.

One optimization is missing that will probably be key in the future: the ability
to merge multiple function nodes and execute them at the same time. Currently
the entire function evaluation is started and finished for every function node
that outputs a grid. This will add significant overhead in some situations.
Implementing this optimization requires some more changes outside of the scope
of this patch though. It's good to have something that works first.

Note: Not all function nodes are supported yet, because we don't have grid types
for all of them yet. Most notably, there are no color/float4 grids yet.
Implementing those properly is not super straight forward and may require some
more changes, because there isn't a 1-to-1 mapping between grid types and socket
types (a float4 grid may correspond to a color or vector socket later on).

Using grids with function nodes and fields can result in false positive warnings
in the UI currently. That's a limitation of our current socket type inferencing
and can be improved once we have better socket shape inferencing.

Pull Request: https://projects.blender.org/blender/blender/pulls/125110
2025-05-19 18:30:58 +02:00
Colin Basnett
39c2f01b51 Nodes: add Bit Math node
This adds a new Bit Math node which supports the following operations: `and`,
`or`, `xor`, `not`, `shift` and `rotate`.

For the `shift` and `rotate` operations, a posititive shift is a left shift and
a negative shift is a right shift.

Currently, the node always works on 32-bit integers which is what Geometry Nodes
uses internally for integers. If required, this can be extended to work on other
bit widths in the future.

The need for this came up every now and then. It can be useful when encoding
specific bits in integer attributes (for efficiency or because the geometry is
exported to other software that expects a certain format). Also, this node is
useful for some people doing crazy but fun things with Geometry Nodes like
emulating hardware. Even if the use-cases are not common, if they arise, it's
hard to work around and the cost of having this node is quite low for us.

Co-authored-by: Charlie Jolly <charliejolly@noreply.localhost>

Pull Request: https://projects.blender.org/blender/blender/pulls/138290
2025-05-19 18:03:05 +02:00
Jacques Lucke
81275eff60 Nodes: improve forward compatibility for unknown interface item types
#138747 adds a new interface item type for separators. Unfortunately, the
current code is not forward-compatible with those. This patch improves forward
compatibility by removing all unknown tree interface item types on-load.

Pull Request: https://projects.blender.org/blender/blender/pulls/139015
2025-05-19 17:52:15 +02:00
Clément Foucault
caac241c84 GPU: Make Shader Specialization Constant API Thread Safe
This allows multiple threads to request different specializations without
locking usage of all specialized shaders program when a new specialization
is being compiled.

The specialization constants are bundled in a structure that is being
passed to the `Shader::bind()` method. The structure is owned by the
calling thread and only used by the `Shader::bind()`.
Only querying for the specialized shader (Map lookup) is locking the shader
usage.

The variant compilation is now also locking and ensured that
multiple thread trying to compile the same variant will never result
in race condition.

Note that this removes the `is_dirty` optimization. This can be added
back if this becomes a bottleneck in the future. Otherwise, the
performance impact is not noticeable.

Pull Request: https://projects.blender.org/blender/blender/pulls/136991
2025-05-19 17:42:55 +02:00
Nikita Sirgienko
cfb8aa24b2 Build: Upgrade OIDN to the release v2.3.3
This release brings several fixes that Blender no longer needs
to patch manually, as well as support for various new and
upcoming hardware.

Pull Request: https://projects.blender.org/blender/blender/pulls/138171
2025-05-19 17:39:41 +02:00
Hans Goudey
6562033a4a Cleanup: Use StringRef for some UI string arguments
Instead of StringRefNull.

Pull Request: https://projects.blender.org/blender/blender/pulls/139095
2025-05-19 17:25:52 +02:00
Jacques Lucke
f3294bbd06 Nodes: improve drawing with invalid zone links
Previously, whenever the zone detection algorithm could not find a result, zones
were just not drawn at all. This can be very confusing because it's not
necessarily obvious that something is wrong in this case.

Now, invalid zones and links that made them invalid have an error.

Note, we can't generally detect the "valid part" of zones when there are invalid
links, because it's ambiguous which links are valid. However, the solution here
is to remember the last valid zones, and to look at which links would invalidate
those. Since the zone-detection results in runtime-only data currently, the
error won't show when reopening the file for now.

Implementation wise, this works by keeping a potentially outdated version of the
last valid zones around, even when the zone detection failed. For that to work,
I had to change some node pointers to node identifiers in the zone structs, so
that it is safe to access them even if the nodes have been removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/139044
2025-05-19 17:25:36 +02:00
Sean Kim
6d0c33e8e7 Cleanup: Deduplicate object space radius calculation
* Also renames the method to make the meaning more obvious

Pull Request: https://projects.blender.org/blender/blender/pulls/139038
2025-05-19 17:13:54 +02:00
Sean Kim
06306dfed6 Cleanup: Minor changes for dynamic_topology_update
* Use constexpr instead of const
* Remove unused location calculation

Pull Request: https://projects.blender.org/blender/blender/pulls/139040
2025-05-19 17:11:30 +02:00
Clément Foucault
ca88983af2 EEVEE: Reverse-Z implementation
This feature greatly increase depth buffer precision.
This is very noticeable in large view distance scenes.

This is enabled by default on GPUs that supports it (most of the hardware we
support already supports this). This makes rendering different on the GPUs
that do not support that feature (`glClipControl`).

While this give much better depth precision as before, we also have a lot of
imprecision caused by our vertex transformations. This can be improved in
another task.

Pull Request: https://projects.blender.org/blender/blender/pulls/138898
2025-05-19 16:29:26 +02:00
Philipp Oeser
cb8f0c7800 Fix #139031: Armature Edit mode can't reveal hidden bones
Caused by 9c35656766

More like a typo, in that commit, `ANIM_bonecoll_is_visible_editbone`
was swapped with `blender::animrig::bone_is_visible_editbone` (but that
was only meant to replace `ANIM_bone_is_visible_editbone`)

So to resolve, just use `ANIM_bonecoll_is_visible_editbone` again

Pull Request: https://projects.blender.org/blender/blender/pulls/139077
2025-05-19 16:26:58 +02:00
Hans Goudey
ed422eadce Fix: Assert in Set Tool Selection node with floats 2025-05-19 10:18:47 -04:00
Sebastian Parborg
62ccba022c Fix #139007: Input string refresh calls missing for Win IME
The update/refresh calls got removed by mistake in #138871.
2025-05-19 16:06:19 +02:00
Lukas Tönne
5180930e0d Fix #138933: Support assigning a default value to menus wrapping node groups
The modifier input value for menu items is an int property, which is not
compatible with the enum property used in node group socket definitions for
menus. Wrapping a node group with a menu will try to assign the int value from
the modifier directly to the enum, which expects a string identifier.

To aquire the matching string identifier, use the UI properties in the modifier
RNA, which contain the complete enum item definition.

Pull Request: https://projects.blender.org/blender/blender/pulls/139074
2025-05-19 15:49:45 +02:00
Jeroen Bakker
808ba086f1 Cleanup: Vulkan: Feature chain
In stead of keeping track of a local variable this PR will keep a list
of all feature structs and at the end populate the pNext.

Pull Request: https://projects.blender.org/blender/blender/pulls/139092
2025-05-19 15:45:50 +02:00
Jacques Lucke
e87f744134 Nodes: show internal links independent of whether output is linked
Previously, internal links of node are only shown when the link is muted AND
when the corresponding output is linked to something else. I can't think of any
reason for why it's important whether the output is linked or not. It seems
showing the internal link is always useful.

This patch makes it so that all internal links are always shown when a node is
muted, regardless of whether the corresponding output socket is linked or not.

Pull Request: https://projects.blender.org/blender/blender/pulls/139086
2025-05-19 15:40:55 +02:00
Jacques Lucke
d9317046b2 Nodes: initialize node name from group name
Previously, when adding a group node it was always called `Group`. This is not
particularly useful. Also it's inconsistent with many other places like adding
modifiers where the name of the modifier depends on what modifier is added.

Now, newly added group node will have the same name as the group that it calls.
Node names still have to be unique though, so e.g. `.001` is still added.

Pull Request: https://projects.blender.org/blender/blender/pulls/139093
2025-05-19 15:39:44 +02:00
Jacques Lucke
e981345a73 Fix #139055: failing implicit conversion between different subtypes
There are separate `bNodeSocketType` for each subtype. Hence, comparing
their pointers is not enough to determine whether a conversion is necessary.

Pull Request: https://projects.blender.org/blender/blender/pulls/139083
2025-05-19 15:39:09 +02:00
Jacques Lucke
16ad67d34c Tests: have test_object active by default in regression test files
When opening Geometry Nodes regression test files I always find a bit annoying
that the `expected_object` and not the `test_object` is active. That's because
only the `test_object` contains the modifier or node tree that is being tested.
Therefore, usually my first step when opening these files is to select the
`test_object` first.

This patch changes it so that when mesh tests are updated, the `test_object` is
made active in the end before the file is saved again.

Pull Request: https://projects.blender.org/blender/blender/pulls/139088
2025-05-19 15:38:17 +02:00
Jeroen Bakker
e844e0c90d Vulkan: Enable robustness2 null descriptors
This change will enable VK_EXT_robustness2.nullDescriptors feature.
It will be able to guarantee that shaders run even when some resources
are not attached.

There should not be any difference with before as this feature is often
the default behavior of GPUs. However it makes the intent more explicit
that failing allocations can still run similar to OpenGL. It is expected
that some tweaks are needed in Vulkan backend.

Pull Request: https://projects.blender.org/blender/blender/pulls/139090
2025-05-19 14:43:55 +02:00
Brecht Van Lommel
d10493aa21 Build: Avoiding linking against system yaml-cpp and pystring on macOS
OpenColorIO is now a dynamic library, and these are included in it. The
legacy code for the static library case was causing the Homebrew libraries
to be found and linked to.

Pull Request: https://projects.blender.org/blender/blender/pulls/139087
2025-05-19 14:38:55 +02:00
Bastien Montagne
498dd0e224 I18N: Updated UI translations from git/weblate repository (74d14bea6). 2025-05-19 14:16:58 +02:00
YimingWu
236f401695 Grease Pencil: Allow filtering by layer groups in modifiers
Previously modifiers can only filter single layers, now filtering by
layer group is also supported.

This adds a toggle to the layer filter to switch to filtering by groups.

Resolves  #123323.

Pull Request: https://projects.blender.org/blender/blender/pulls/123353
2025-05-19 13:56:35 +02:00
Jeroen Bakker
d87e0ecb61 Fix: Vulkan: Incorrect Std430 memory layout
When using float2/int2/uint2 arrays the elements could be incorrectly
alligned. This wasn't noticable when using Blender as it isn't used,
However python addons and forks can use it.

Fixes an issue with UPBGE

Pull Request: https://projects.blender.org/blender/blender/pulls/139082
2025-05-19 13:24:19 +02:00
Miguel Pozo
239eb386ff Fix #139064: EEVEE: Resizing render region can cause a crash
Clamp the render rect to the viewport area.
2025-05-19 12:49:29 +02:00
Alaska
ce0ec6e708 Cycles: Disable MNEE in the HIP backend
MNEE on HIP has rendering artifacts on RDNA1 (#134978), RDNA2 (#139068)
and RDNA4 (#136980), and can lock up the GPU under specific situations with
RDNA3 (#138607).

There are certain configurations that work (E.g. RDNA4 seems to work on
Linux), but the number of configurations that work keep dropping as further
developments are made in other areas. So it was decided it's just better to
disable MNEE entirely on HIP.

This commit disables MNEE on HIP, and does a small cleanup to remove the
unused functions as a result of this change.

Fix #139068: MNEE renders with artifacts on RDNA2
Fix #138607: MNEE render test stalls on RDNA3

Pull Request: https://projects.blender.org/blender/blender/pulls/139069
2025-05-19 12:42:20 +02:00
Habib Gahbiche
cf79f19570 Compositor: support link search for filter node
Show filter types (Sobel, Diamond Sharpen, etc..) in the link search
menu.

Pull Request: https://projects.blender.org/blender/blender/pulls/139081
2025-05-19 12:39:44 +02:00
Jeroen Bakker
2143eb7a4f Refactor: Vulkan/OpenXR: Import memory handles only once
Importing memory is done to often. when memory doens't change the
previous imported memory can be used.

The idea is to keep track of the last used buffer and keep reusing
it until the view/resolution has changed. This should not happen during
a session.

Pull Request: https://projects.blender.org/blender/blender/pulls/138984
2025-05-19 12:32:08 +02:00
Brecht Van Lommel
358de9e6c9 Fix #139010: Cycles USD motion blur shading artifacts
This code should not have been removed in 47e1b24c29.
2025-05-19 12:12:46 +02:00
Brecht Van Lommel
1e3a7c8c88 Fix #138986: Cycles curve intercept and length rendering wrong
Missed updating these in a previous refactor.
2025-05-19 12:10:46 +02:00
Brecht Van Lommel
59b4842117 Cycles: Adaptive subdivision triangular patches
There is a corner case where one side of a quad needs splitting and the other
side has only one segment. Previously this would produce either gaps or after
recent changes to stitch together geometry, uninitialized memory.

Now solve this by splitting into triangular patches, as suggested in the
DiagSplit paper. These triangular patches can be further subdivided themselves.
Dicing has special cases for 1 or 2 segments on edges. For more segments it
works the same as: quad dicing: A regular inner triangle grid stitched to the
outer edges.

Fix #136973: Inconsistent results with adaptive subdivision

Pull Request: https://projects.blender.org/blender/blender/pulls/139062
2025-05-19 12:04:11 +02:00