Commit Graph

150077 Commits

Author SHA1 Message Date
наб
4710639619 Fix: GNUmakefile error erroring without the error message on Win32
Ref !136839
2025-04-04 21:02:47 +11:00
Omar Emara
9725fa0c84 Fix: Node are duplicated in link add search menu
Some nodes like the Math and Mix Color node are duplicated when looking
at the link add search menu. That's because all nodes are considered in
that operation, even ones that are not listed in the menu. To fix this,
just disable the functionality for those legacy nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/136979
2025-04-04 12:00:39 +02:00
Omar Emara
12ba9770db Fix #136699: Denoise node crash in viewport compositor
The Denoise node crashes if used in the viewport compositor. That's
because OIDN uses the compositor context in a different thread, which
does not have access to the DRW context. To fix this, we assign relevant
context data to the compositor context from the DRW context before
running the evaluator, then make the compositor context return those
data instead of accessing the DRW context.
2025-04-04 11:59:23 +02:00
Jeroen Bakker
d6687de291 Cleanup: Code-style 2025-04-04 11:56:02 +02:00
илья _
f3f9aaf4f7 Fix: Tests: Geometry Nodes tests ignore threshold value
Base constructor ask test name as the third argument,
so threshold have to be named parameter in case test name is not mentioned

Pull Request: https://projects.blender.org/blender/blender/pulls/134300
2025-04-04 11:52:16 +02:00
Jacques Lucke
ea604b6b80 Fix: avoid crash when there is an unknown interface socket
This needs to be backported to fix #136949.
2025-04-04 11:26:36 +02:00
Omar Emara
56b0b709ea Compositor: Support GPU OIDN denoising
This patch supports GPU OIDN denoising in the compositor. A new
compositor performance option was added to allow choosing between CPU,
GPU, and Auto device selection. Auto will use whatever the compositor is
using for execution.

The code is two folds, first, denoising code was adapted to use buffers
as opposed to passing in pointers to filters directly, this is needed to
support GPU devices. Second, device creation is now a bit more involved,
it tries to choose the device is being used by the compositor for
execution.

Matching GPU devices is done by choosing the OIDN device that matches
the UUID or LUID of the active GPU platform. We need both UUID and LUID
because not all platforms support both. UUID is supported on all
platforms except MacOS Metal, while LUID is only supported on Window and
MacOS metal.

If there is no active GPU device or matching is unsuccessful, we let
OIDN choose the best device, which is typically the fastest.

To support this case, UUID and LUID identifiers were added to the
GPUPlatformGlobal and are initialized by the GPU backend if supported.
OpenGL now requires GL_EXT_memory_object and GL_EXT_memory_object_win32
to support this use case, but it should function without it.

Pull Request: https://projects.blender.org/blender/blender/pulls/136660
2025-04-04 11:17:08 +02:00
Falk David
f17148458d Fix #136844: Grease Pencil vertex colors can get corrupted
Currently, tools like the sculpt tools or vertex paint tools don't do
any viewport culling of points. Meaning that when the screen space
positions are calculated, points that are very far away off-screen,
don't get discarded.

This lead to an issue in `brush_point_influence` because the coordinates
 and the distance function were using 32-bit integers. When a point
was far enough away from the mouse position, this caused an overflow
to happen and the distance as well as the influence returned was negative.

To fix the immediate issue, do the distance calculation using floating
point to avoid the calculation from overflowing.

Note that we should still perform viewport culling of points to avoid
this computation alltogether.

Pull Request: https://projects.blender.org/blender/blender/pulls/136976
2025-04-04 11:14:05 +02:00
Eitan Traurig
a952f5dda6 UI: Rename "Hide Collection" operator to "Hide Other Collections"
The current naming of the Hide Collection operator is counterintuitive.
Hide collection implies that it hides the selected collection, but it hides
all the collections that are not selected.

Pull Request: https://projects.blender.org/blender/blender/pulls/129682
2025-04-04 10:56:27 +02:00
Campbell Barton
620f9271e6 Refactor: use a more directly method of applying UV sticky selection
Replace use of the UvVertMap table with checks using the existing
connectivity data.

This has the advantage that it's simpler to extend to support
for other kinds of connectivity checks - such as flushing
the selection to edges.
2025-04-04 08:02:00 +00:00
Sean Kim
3d08408e73 Fix: Clay strips brush does nothing with 'Original Plane' set
Introduced in de1c911d49

As noted in the comments of this commit, early returning in the
calculation of the Clay Strips brush prior to the plane being calculated
causes the initial value to be unset, which causes the brush to have no
effect even in the initial radius.

Pull Request: https://projects.blender.org/blender/blender/pulls/136962
2025-04-04 07:11:48 +02:00
nutti
07e6f78ac1 PyDoc: Add base class of bpy_prop_collection_idprop
`bpy_prop_collection_idprop` is inherited from `bpy_prop_collection`.
Python API doc does not reflect this specification now.

Ref !136382
2025-04-04 16:07:26 +11:00
Campbell Barton
f1fb9d25ff CMake: remove illogical hint for OSL_SHADER_HINT
Resolve CMake warning, using an undefined variable.

Don't attempt to use OSL_SHADER_DIR in it's own hint,
introduced in fix for #73830.

This was also overwriting the previous assignment from "OSL_COMPILER".

Ref !136961
2025-04-04 04:49:25 +00:00
Campbell Barton
876d3d7522 Cleanup: minor simplification to UV selection check 2025-04-04 01:48:06 +00:00
Campbell Barton
4139d4a8f0 Cleanup: spelling in comments (make check_spelling_*) 2025-04-04 12:48:04 +11:00
Alaska
31633d14b5 Fix #136860: Build failure on big endian platforms
This commit fixes a issue where Blender would not compile
on big endian platforms due to a missing include.

Pull Request: https://projects.blender.org/blender/blender/pulls/136864
2025-04-04 03:13:52 +02:00
Campbell Barton
74900afa56 Cleanup: quiet unused warnings 2025-04-04 10:33:33 +11:00
Campbell Barton
4996f9eed9 PyDoc: use context manager to avoid resource leak writing log-file 2025-04-04 10:32:13 +11:00
nutti
eb3fb565bd PyDoc: correct formatting for GPUShaderCreateInfo.depth_write
Ref !136846
2025-04-04 10:18:34 +11:00
Campbell Barton
57fde0ee77 PyDoc: fix resource leak warning when generating docs
Use the context manager to avoid having to explicitly close files.
2025-04-04 10:15:44 +11:00
Campbell Barton
357e7e1ab2 PyDoc: support disabling online access when building the API docs 2025-04-04 10:14:21 +11:00
Campbell Barton
83135f2849 Cleanup: quiet warning for undefined variable use in CMake 2025-04-04 09:46:03 +11:00
Germano Cavalcante
855ad33936 Fix #136938: bpy.path.module_names does not return list[str]
The documentation at
https://docs.blender.org/api/4.4/bpy.path.html#bpy.path.module_names
points out that `bpy.path.module_names` returns `list[str]`, while it
actually returns `list[tuple[str, str]]`.

Besides fixing the documentation, this commit also removes a leftover
debug print.

Pull Request: https://projects.blender.org/blender/blender/pulls/136951
2025-04-03 23:54:56 +02:00
Sean Kim
2307ce1722 Fix: Use math::is_zero instead of equality check for assert
Introduced in e41ed565ff

Pull Request: https://projects.blender.org/blender/blender/pulls/136959
2025-04-03 23:40:36 +02:00
Sean Kim
e41ed565ff Cleanup: Clarify brush plane calculation
* Remove comments that add noise
* Restructure code slightly
* Add asserts
* Switch to some new C++ math functions
* Extract bool for readability

Pull Request: https://projects.blender.org/blender/blender/pulls/136956
2025-04-03 22:38:23 +02:00
Jesse Yurkovich
778e96c033 Cleanup: USD: Remove duplicate implementation of get_unique_path
Put it in a common place.

Pull Request: https://projects.blender.org/blender/blender/pulls/136953
2025-04-03 21:27:15 +02:00
Sean Kim
0e840cf065 Refactor: Restructure paint BVH node gathering methods
This commit extracts the statements that calculate a brush's relevant
paint BVH node `IndexMask` into a dedicated method. A helper return
`struct` is introduced for the `optional` `plane_center` and
`plane_normal` values that are only relevant for the Plane brush
currently.

Pull Request: https://projects.blender.org/blender/blender/pulls/136859
2025-04-03 20:03:51 +02:00
Clément Foucault
d4d5136da0 Fix #136850: HDRI Preview Flickering in Viewport Shading
This was caused by the manager being in sync phase only
between `begin_sync` an `end_sync`. The drawcalls sync
inside `begin_sync` like the lookdev sphere were given
bogus handles.

This also remove some uneeded functions wrappers.
2025-04-03 19:35:51 +02:00
Sergey Sharybin
85a97b01a9 Fix: Warnings after Ceres update
The external libraries did not properly ignore Wreorder for GCC and MSVC.

Pull Request: https://projects.blender.org/blender/blender/pulls/136946
2025-04-03 19:13:07 +02:00
Pratik Borhade
b2950de4a2 Fix #136645: Regression: Preview generation fails for multiple IDs
Fixes: #136842, #136645

Caused by 76d6d169ba
When multiple objects are selected to mark as assets, preview generation
job of previous ID in the for loop is cleared by `ED_preview_kill_jobs`
inside `generate_preview`. To fix this, check if `id->preview` exists then
clear the preview job if exists inside the new function
`ED_preview_kill_jobs_for_id`.
Solution proposed by @JulianEisel. I came up with idea to use `wm_job_find`

Pull Request: https://projects.blender.org/blender/blender/pulls/136918
2025-04-03 19:12:54 +02:00
Omar Emara
0b67bbc16a Fix #136812: Glitches in White Noise node in compositor
The White Noise node in the compositor glitches. That's because the
alpha channel in GPU code is uninitialized. So we simply initialize it
to 1.
2025-04-03 19:09:58 +02:00
Clément Foucault
d7359c8164 Fix #136883: DRW: Crash with empty point cloud
This was caused by an emtpy VBO being bound as
a texture. This is undefined behavior on some implementation.
2025-04-03 18:53:22 +02:00
Hans Goudey
c85b297aac Mesh: Parallelize face to point domain adaptation
Similar to eae60bc3e6.

The performance improvement depends on the attribute type, domain size,
and whether the cached vert to face map is used for something else like
vertex normal calculation during evaluation. In a simple test with a
large cube, I observed a 6.7x improvement in overall FPS for a 4x4
matrix attribute, a 1.12x improvement for a float attribute, and
roughly equivalent performance for booleans.

Pull Request: https://projects.blender.org/blender/blender/pulls/136941
2025-04-03 18:39:49 +02:00
Jonas Holzman
31175ccf19 Deps: macOS: Fix libffi build error on Xcode 16.3 / Apple Clang 17
This PR adds a simple patch to fix libffi compilation errors on Xcode
16.3 / Apple Clang 17. This patch has been ported from libffi Github
PR #857[1] and has now since been included in libffi 3.4.7

[1]: https://github.com/libffi/libffi/pull/857

The reason why we patch libffi v3.4.4 instead of just upgrading to 3.4.7
is that Python require specific versions of its dependencies. (See
comment in build_environment/cmake/versions.cmake about updating Python
version)

Once we upgrade Python and libffi is updated to 3.4.7 or beyond,
this patch can be safely removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/136934
2025-04-03 18:37:30 +02:00
Sebastian Parborg
73a466c44f Deps: Linux x64: Add new Manifold library 2025-04-03 18:25:59 +02:00
Hans Goudey
7e4d50f1db Geometry Nodes: Align inputs and outputs in many nodes
In several nodes such as the capture attribute, bake, simulation, repeat,
and For Each nodes, we already use alignment of input and output sockets
to show when they correspond, make better use of space, and simplify
the UI. This PR extends that change to many more nodes. Sockets are
aligned when they have the same name and data propagates between
them. For now the various "sampling" nodes like Raycast and Sample
Nearest Surface are left out since their interface is a bit more complex.

Backward and forward compatibility aren't affected by this change;
it's just visual.

Pull Request: https://projects.blender.org/blender/blender/pulls/135876
2025-04-03 17:53:56 +02:00
Hans Goudey
d4b23d38c9 Cleanup: Formatting 2025-04-03 11:44:25 -04:00
Clément Foucault
0fdbeba2c3 Fix #136911: Overlay: 3D Cursor disappears when opening File Open dialogue
One of the push constant was not set and was thus
in the last state is was in. This is because
we are not using the Batch or IMM API to draw
the batch, and thus, this push constant has to be
set manually upfront.
2025-04-03 17:28:09 +02:00
Mattias Fredriksson
eae60bc3e6 Mesh: Parallelize corner to point domain adaptation
This commit parallelizes attribute domain interpolation for meshes from
the face corner to vertex domain. Parallel iteration is implemented
using the vertex to face topology map. The same map is used for mesh
normal computations and benefits from potential cost amortization in
its shared cache. This approach then tries to maximize cache usage
while minimizing potential memory consumption by avoiding caching
multiple topology maps.

The performance gain is dependent on the attribute type and domain size.
For a mesh with 16M vertices and 4x4 matrix attribute interpolation,
a 4.5x performance improvement was observed (from 10.7s to 2.38s).

Pull Request: https://projects.blender.org/blender/blender/pulls/135372
2025-04-03 17:01:41 +02:00
Clément Foucault
299a581b1b Grease Pencil: Accumulation Anti-aliasing
This adds a new more accurate antialiasing to the Grease Pencil
render engine. This is only available for render.

This Accumulation AA doesn't replace the SMAA. SMAA is still
used by the viewport and for removing aliasing from the
depth buffer. However, using both at the same time can lead
to overblurred result.

Here are some measurements for how much the render time
increases compared to the baseline with different (SSAA) sample
counts (using an example production file, rendered at 1080p,
results might vary depending on the scene complexity):
* 8 samples: +0.14 s
* 16 samples +0.36 s
* 32 samples: +0.58 s

Co-authored-by: Falk David <falk@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/136551
2025-04-03 16:52:05 +02:00
Clément Foucault
3064906eb7 Cleanup: GPU: Add ATTR_FALLTHROUGH for shader C++ compilation 2025-04-03 16:38:21 +02:00
Clément Foucault
d767317bd0 Cleanup: GPU: Remove unused geometry_source in create infos 2025-04-03 16:38:21 +02:00
Michael Jones
326d5bca03 Cycles: Support Decomposed MetalRT motion interpolation
Currently MetalRT interpolates transformation matrix on per-element basis
which leads to issues like #135659.

This change adds implementation of for decomposed (Scale/Rotate/Translate)
motion interpolation, matching behavior of BVH2 and other HW-RT.

This requires macOS 15 and Xcode 16 in order to use this interpolation.
On older platforms and compilers old interpolation is used.

Currently there is no changes on the user (by default) and it is only
available via CYCLES_METALRT_PCMI environment variable. This is because
there are some issues with complex motion paths that need to be looked
into. Having code available makes it easier to do further debugging.

Ref #135659

Authored by Emma Liu

Pull Request: https://projects.blender.org/blender/blender/pulls/136253
2025-04-03 16:24:04 +02:00
Sergey Sharybin
59991e54f5 Update Ceres to version 2.2.0
Brings a lot of performance improvements and bug fixes.

Keyframe selection in bundle-adjustment.blend goes down from
4.5 seconds to 3.0 on M2 Ultra. The reconstruction itself stays
within 0.2 seconds.

Full change log can be found at http://ceres-solver.org/version_history.html

Pull Request: https://projects.blender.org/blender/blender/pulls/136896
2025-04-03 16:20:38 +02:00
Ben Beilharz
0eccadd452 Compositor: Expose interpolation in Scale node
This patch adds a new interpolation option to the Scale node to control
how pixels are sampled during scaling. For constant sizes, this stores
the interpolation for later realization, while for variable sizes, the
interpolation takes effect immediately.

Pull Request: https://projects.blender.org/blender/blender/pulls/135989
2025-04-03 15:50:57 +02:00
Jacques Lucke
8ec9c62d3e Geometry Nodes: add Closures and Bundles behind experimental feature flag
This implements bundles and closures which are described in more detail in this
blog post: https://code.blender.org/2024/11/geometry-nodes-workshop-october-2024/

tl;dr:
* Bundles are containers that allow storing multiple socket values in a single
  value. Each value in the bundle is identified by a name. Bundles can be
  nested.
* Closures are functions that are created with the Closure Zone and can be
  evaluated with the Evaluate Closure node.

To use the patch, the `Bundle and Closure Nodes` experimental feature has to be
enabled. This is necessary, because these features are not fully done yet and
still need iterations to improve the workflow before they can be officially
released. These iterations are easier to do in `main` than in a separate branch
though. That's because this patch is quite large and somewhat prone to merge
conflicts. Also other work we want to do, depends on this.

This adds the following new nodes:
* Combine Bundle: can pack multiple values into one.
* Separate Bundle: extracts values from a bundle.
* Closure Zone: outputs a closure zone for use in the `Evaluate Closure` node.
* Evaluate Closure: evaluates the passed in closure.

Things that will be added soon after this lands:
* Fields in bundles and closures. The way this is done changes with #134811, so
  I rather implement this once both are in `main`.
* UI features for keeping sockets in sync (right now there are warnings only).

One bigger issue is the limited support for lazyness. For example, all inputs of
a Combine Bundle node will be evaluated, even if they are not all needed. The
same is true for all captured values of a closure. This is a deeper limitation
that needs to be resolved at some point. This will likely be done after an
initial version of this patch is done.

Pull Request: https://projects.blender.org/blender/blender/pulls/128340
2025-04-03 15:44:06 +02:00
Andrej730
508fc4c8a8 Fix #136891: changed legacy enum names for some compositor nodes
Followup to b43e2168e3.

Pull Request: https://projects.blender.org/blender/blender/pulls/136928
2025-04-03 15:43:56 +02:00
Xavier Hallade
3dd6104c87 Cycles: oneAPI: Fix building for non-Intel SYCL targets without ocloc
The current logic disables WITH_CYCLES_ONEAPI_BINARIES when ocloc is not
found, which is fine, but prevented building for other non-Intel SYCL
targets without (unnecessary) ocloc.

The fix here is to remove spir64_gen target when
WITH_CYCLES_ONEAPI_BINARIES is disabled, instead of forcing only spir64.
2025-04-03 15:13:57 +02:00
Julian Eisel
5ea2ab3559 Fix: Adding Freestyle texture doesn't add texture tab in properties
Found while investigating #136359.

Steps to reproduce:
- Switch 3D View in Layout workspace to Texture Nodes Editor
- Set the Texture Type selector to Line Style
- Press New
- Notice how no Texture tab appears in the Properties, even though there
  is a texture user on the frestyle line set now.

Pull Request: https://projects.blender.org/blender/blender/pulls/136621
2025-04-03 15:06:37 +02:00
Clément Foucault
f8de6c31bc EEVEE: Move Object ID storage to gbuffer header layer
This allow to store the full object ID inside a `uint32`
buffer. This allows to get the per object data in deferred
passes and avoid to store object data inside the Gbuffer.

This data is only written if needed.

This had to modify the implementation of subpass input
for all backend to be able to bind layered texture.
This currently work because only the layer 0 is bound to the
framebuffer. This is fragile but I don't see a good builtin way
to fix it.

Rel #135935

#### Tasks
- [x] Replace light linking bits in Gbuffer
- [x] Replace Object ID in GBuffer for SSS
- [x] Conditional storage
- [x] Dummy storage if not needed

Pull Request: https://projects.blender.org/blender/blender/pulls/136428
2025-04-03 14:00:55 +02:00