Commit Graph

148438 Commits

Author SHA1 Message Date
Germano Cavalcante
3ab65cff04 Windows: show popup after crash
Implements a crash dialog for Windows.

The crash popup provides the following actions:
- Restart: reopen Blender from the last saved or auto-saved time
- Report a Bug: forward to Blender bug tracker
- View Crash Log: open the .txt file with the crash log
- Close: Closes without any further action

Pull Request: https://projects.blender.org/blender/blender/pulls/129974
2025-04-04 18:38:53 +02:00
Clément Foucault
3179cb0069 Cleanup: GPU: Remove unused legacy_resource_location 2025-04-04 18:21:52 +02:00
Miguel Pozo
2d75688259 GHOST: Add GHOST_GetActiveGPUContext()
Track the (per-thread) active `GHOST_Context`.
This is required to restore the active context after creating a new one
if the current context is unknown.
(Required for creating GPU contexts in the GPU module without depending
on the WM module)

Pull Request: https://projects.blender.org/blender/blender/pulls/136992
2025-04-04 18:14:13 +02:00
Jeroen Bakker
a46643af0f Vulkan/OpenXR: Add support for VK_KHR_external_memory_fd
Current implementation uses a CPU roundtrip to transfer render result
to the Xr Swapchain. This PR adds support for sharing the render result
on Linux systems by using file descriptors.

To extend this solution to win32 or dx handles can be done by extending
the data transfer modes, register the correct extensions. When not
using the same GPU between Blender and OpenXR the CPU roundtrip
will still be used.

Solution has been validated with monado simulator and seems to be as
fast as OpenGL.

Performance can be improved by using GPU based synchronization.
Current API is limited as we cannot chain the different renders and
swapchains.

Pull Request: https://projects.blender.org/blender/blender/pulls/136933
2025-04-04 16:01:06 +02:00
илья _
2a092a623b Fix: #136269: Geometry Nodes: crash due to missing collection in depsgraph
When the collection is disabled and was only referenced by a node tree, it was
missing from the depsgraph. The Geometry Nodes modifier tried to add a relation
to it, but it couldn't because the collection was not in the depsgraph in the first place.

Now, the collection is always added to the depsgraph when it's referenced by a
node tree that's in the depsgraph too. This makes the existing code that adds the
relation from the collection to the Geometry Nodes modifier work.

Pull Request: https://projects.blender.org/blender/blender/pulls/136328
2025-04-04 15:55:07 +02:00
Clément Foucault
3562433ae7 pyGPU: Deprecate Shader.program getter
This is getting in the way of making the
GPUShader API more threadsafe.

This getter already doesn't work for vulkan
and Metal, and has very limited usage.

Keeping the python function to avoid errors
and display a deprecation warning.

Pull Request: https://projects.blender.org/blender/blender/pulls/136983
2025-04-04 14:23:09 +02:00
Weizhen Huang
0dc46773e0 Fix: Cycles Render Scheduler not respecting sample limit per update
Delay the clamping until later

Pull Request: https://projects.blender.org/blender/blender/pulls/136984
2025-04-04 14:17:08 +02:00
Omar Emara
cc21dcb436 Fix #136866: Voronoi 1D crashes GPU compositor
The GPU compositor crashes if 1D Voronoi is used. That's because the
vector input is unavailable in that mode, but the GPU material compiler
considers all inputs, even unavailable ones. So we need to link those
sockets to some arbitrary constant value.
2025-04-04 14:04:05 +02:00
Omar Emara
cc84830abc Cleanup: No previous declaration warning 2025-04-04 12:47:29 +02:00
Sybren A. Stüvel
a9f4f211d4 Fix #136967: Crash on Merge Animation when Slot has no Channelbag
The Merge Animation operator assumed that when a keyframe strip exists,
it always has a channelbag for the to-be-moved slot. This isn't
necessarily the case, so now it only moves the channelbag if it exists.

Pull Request: https://projects.blender.org/blender/blender/pulls/136978
2025-04-04 12:22:47 +02:00
YimingWu
b54d629401 Fix: Line Art: Prevent loading empty meshes
In `lineart_geometry_check_visible` it could recieve a valid mesh
without any vertices, this causes `bounds` below to be invalid.
Now return early if encountered such situation.

Pull Request: https://projects.blender.org/blender/blender/pulls/136819
2025-04-04 12:04:20 +02:00
наб
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