Commit Graph

153003 Commits

Author SHA1 Message Date
Miguel Pozo
e0b281a505 Fix: GL Compilation Subprocess file locking
Prevent the cache file from being locked if the driver hangs during
validation.
2025-08-13 16:05:33 +02:00
Miguel Pozo
6cf196044e Fix: GL Compilation Subprocess race condition
Prevent the main process from writing to shared memory while the cache
file is being written to disk.
2025-08-13 16:03:42 +02:00
Jacques Lucke
c90a137a27 Nodes: wrap int in MenuValue type for menu sockets
Previously, we always just used `int` when dealing with menu values on the C++
side. It's currently the only type where we have the same base type (`int`) for
two different socket types (integer and menu sockets). This has some downsides:
* It requires special cases in some places.
* There is no function from static base type to socket type (which is useful for
  some utilities like `SocketValueVariant`).
* It implicitly allows operations on menu values that shouldn't be allowed such
  as arithmetic operations and conversions to and from other types.

This patch adds a new `MenuValue` type that is used for menu sockets in Geometry
Nodes and the (CPU) Compositor, clarifying the distinction between integer and
menu values.

Pull Request: https://projects.blender.org/blender/blender/pulls/144476
2025-08-13 15:43:37 +02:00
Bastien Montagne
09d357f878 Fix #144305: Crash adding workspace to startup file.
Code is trying to append from itself, this is not allowed (and will
assert in debug builds).

Instead, create a new copy of the matching local workspace. This
allows to keep identical behavior from user PoV, when the source
workspace is in the same blendfile.

Pull Request: https://projects.blender.org/blender/blender/pulls/144352
2025-08-13 15:34:10 +02:00
Bastien Montagne
c90c4e9cd5 Tests: LibOverride: Simply some code, add 'empty lib' test case.
Code checking for expected amount of local/linked/missing
linked/liboverrides IDs is now cleaner and more efficient.

Also add a test where the whole content of the source library is
removed, to validate that liboverrides using these linked IDs as
reference remain available as 'placeholders'.
2025-08-13 15:16:02 +02:00
Christoph Neuhauser
1384bad2d2 GPU: Add flag for shader debug info generation
This PR proposes to add a new flag `--shader-debug-info` that enables the generation of shader debug information.

I created this PR as WIP due to the following reasons:
- Currently it only works for the Vulkan backend. I do not know if it makes sense for other backends. For example, OpenGL directly receives the GLSL code, so there no need for this might exist.
- So far `--debug-gpu-renderdoc` already turns on the following changes for GLSL shader compilation with shaderc:
```
options.SetOptimizationLevel(shaderc_optimization_level_zero);
options.SetGenerateDebugInfo();
```
- While combining optimization level zero with debug info is a sensible choice for frame debuggers like RenderDoc, my use case for creating this PR is shader profiling. In this case, one does not want compiler optimizations to be turned off. At the current point in time, the only information my profiler uses (which is unfortunately not public at this point in time) is the name of the shader. When turning on debug information, shaderc/glslang store this information in the generated SPIR-V data. Otherwise, it would be impossible for the profiler to tell the user what the name of the shader it is that is profiled.
- An alternative solution would be to rename the entry point `main` of a shader to the name of the shader. But this might be an even uglier hack, as it requires editing the source code (and the name of the shader then needs to be a valid GLSL function name).
- We should first clarify if there is interest in the Blender side in upstreaming an option like this. While I could just keep this in my local fork of Blender, there is merit in having the possibility to profile arbitrary Blender builds.

Pull Request: https://projects.blender.org/blender/blender/pulls/142986
2025-08-13 13:41:41 +02:00
Pablo Vazquez
02879c2d85 UI: Center-align header modal status text
Align the header text during modal operations to the center, closer to
where the action happens.

See PR for details and screenshots.

Pull Request: https://projects.blender.org/blender/blender/pulls/139507
2025-08-13 13:21:13 +02:00
Falk David
2f852d4f00 VSE: Add scene assets through strip add menu
Adds scene assets (including the catalogue tree) to the `Add` > `Scene` menu.

When selecting a scene asset, the asset import setting is used:
* Link: Scene is linked (cannot be edited, but will be used by the strip)
* Append: Appends the full scene including all IDs to the file.
* Append/Reuse: Appends the scene but will reuse IDs (like mesh data, materials, etc.).
   Objects, collections, and the scene itself are not reused.

Part of #144063.

Pull Request: https://projects.blender.org/blender/blender/pulls/141213
2025-08-13 13:11:47 +02:00
Casey Bianco-Davis
fbbd79aa50 Grease Pencil: Improve cyclical end cap rendering
This improves the rendering of cyclical strokes in Grease Pencil
by connection the start and end lines segments together.

To make this possible the Vertex Shader needs to know if the
curve is cyclical and the start and end of the current stroke.
This PR stores the cyclical in the sign of `point index`. All points
already know the start of the curve as `stroke_id`, so all we
need is the end of the curve. Grease Pencil already uses a
point at the start and end of the stroke as padding.  So if the
first buffer point stored the index to the last buffer point, any
other point and just go to the first point then to the last.

Pull Request: https://projects.blender.org/blender/blender/pulls/143976
2025-08-13 13:00:32 +02:00
Casey Bianco-Davis
fb6f191981 Fix #144369: Grease Pencil: Use aligned handle type in Convert Curve Type operator
This makes so that the `Convert Curve Type` operator will create
bézier handles with the `Aligned` type except for corners.

Pull Request: https://projects.blender.org/blender/blender/pulls/144471
2025-08-13 12:38:33 +02:00
Casey Bianco-Davis
2f8061c65a Fix #144408: Crash when cancelling primitive tool with automerge on empty drawing
The problem was that `automerge` would run even when the
operator was cancelled.
This also fixes a unnoticed bug were unrelated strokes would
merge when the operator was cancelled.

Pull Request: https://projects.blender.org/blender/blender/pulls/144470
2025-08-13 12:36:25 +02:00
Julian Eisel
3c3c01a67c UI: Gray out or hide asset shelf toggle if not available
The "Asset Shelf" checkbox can be confusing for people, they enable it
but it still can't get the shelf to show up. This is because the shelf
is only available in certain contexts (e.g. pose mode and paint modes
in the 3D view, more is planned see blender/blender#135061). Gray out
the toggle with a disabled hint when not available.

The region toggle pie menus will hide the item.

Pull Request: https://projects.blender.org/blender/blender/pulls/113063
2025-08-13 11:38:11 +02:00
Jonas Holzman
da781fd685 UI: Allow Preferences editor to be opened in Maximized Area
This commit adds the option to open the Preferences editor in a
maximized area instead of a new window. This is done by adding a
"Preferences" field to the Interface > Editor > Temporary Editor
preferences. The default value is set to "New Window" keeping the
current behavior.

Implements: #142665

Pull Request: https://projects.blender.org/blender/blender/pulls/142681
2025-08-13 11:26:50 +02:00
Bastien Montagne
b02ebf8e43 Fix #144373: Removing and then redefining an override property causes a crash.
Code needs to ensure it gets an override property operation here, not
only search for an existing one.

Mistake has been there probably for years...
2025-08-13 11:08:29 +02:00
Weizhen Huang
d717c78ca4 Revert "Cycles: Store octree parent nodes in a stack"
This reverts commit bccad10b3be75deb0825b9234087e613678af407.
The stack approach seems slower

Pull Request: https://projects.blender.org/blender/blender/pulls/134460
2025-08-13 10:28:53 +02:00
Weizhen Huang
146ac0d9fe Cycles: Store octree parent nodes in a stack 2025-08-13 10:28:50 +02:00
Weizhen Huang
5646d9a5ca Cycles: Add and update volume test files 2025-08-13 10:28:50 +02:00
Weizhen Huang
ed48905b41 Cycles: Use analytic formula for homogeneous volume 2025-08-13 10:28:50 +02:00
Weizhen Huang
a4f8e0bfa2 Cycles: Use RGBE for denoised guiding buffers to reduce memory usage
Co-authored-by: Brecht Van Lommel <brecht@blender.org>
2025-08-13 10:28:50 +02:00
Weizhen Huang
5cb6014efd Cycles: Volume Scattering Probability Guiding
Guide the probability to scatter in or transmit through the volume.
Only applied for primary rays.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
2025-08-13 10:28:50 +02:00
Weizhen Huang
a7283fc1d5 Cycles: Shade volume with null scattering
The distance sampling is mostly based on weighted delta tracking from
[Monte Carlo Methods for Volumetric Light Transport Simulation]
(http://iliyan.com/publications/VolumeSTAR/VolumeSTAR_EG2018.pdf).

The recursive Monte Carlo estimation of the Radiative Transfer Equation is
\[\langle L \rangle=\frac{\bar T(x\rightarrow y)}{\bar p(x\rightarrow
y)}(L_e+\sigma_s L_s + \sigma_n L).\]
where \(\bar T(x\rightarrow y) = e^{-\bar\sigma\Vert x-y\Vert}\) is the
majorant transmittance between points \(x\) and \(y\), \(p(x\rightarrow
y) = \bar\sigma e^{-\bar\sigma\Vert x-y\Vert}\) is the probability of
sampling point \(y\) from point \(x\) following exponential
distribution.

At each recursive step, we randomly pick one of the two events
proportional to their weights:
* If \(\xi < \frac{\sigma_s}{\sigma_s+\vert\sigma_n\vert}\), we sample
scatter event and evaluate \(L_s\).
* Otherwise, no real collision happens and we continue the recursive
process.

The emission \(L_e\) is evaluated at each step.

This also removes some unused volume settings from the UI:

* "Max Steps" is removed, because the step size is automatically specified
by the volume octree. There is a hard-coded threshold `VOLUME_MAX_STEPS`
to prevent numerical issues.
* "Homogeneous" is automatically detected during density evaluation

An option "Unbiased" is added to the UI. When enabled, densities above
the majorant are clamped.
2025-08-13 10:28:50 +02:00
Weizhen Huang
8c36f9ce49 Cycles: Compute volume transmittance using telescoping 2025-08-13 10:28:50 +02:00
Weizhen Huang
b2b2d9a4f3 Cycles: Render volume by ray marching through octrees
One octree per volume per shader based on the density. In preparation
for the null scattering
2025-08-13 10:28:50 +02:00
Weizhen Huang
4e65ab4490 Cycles: Create one box for vdb mesh instead of many
Due to numerical issues this was creating many wrong self-overlapping.
It was necessary for skipping empty regions, but not any more with the
volume Octree approach
2025-08-13 10:28:50 +02:00
Weizhen Huang
b20b4218d5 Cycles: Always add world as object
but only enable the light when the world is used for NEE.

World object index will be needed for volume stack.
2025-08-13 10:28:50 +02:00
Weizhen Huang
c0843f0649 Cleanup: Cycles: remove unused function 2025-08-13 10:28:50 +02:00
Weizhen Huang
872528814e Cycles: do not sample direct light when ray segment is invalid
Since we sample the same light for distance sampling and equiangular
sampling, the sample is invalid anyway, so just avoid sampling direct
light for distance sampling too.
2025-08-13 10:28:50 +02:00
Bastien Montagne
dcba54a495 Fix #144469: Regression: LiboVerride: Crash on startup in some cases.
Regression from 00375abc38, since hierarchy roots are no more ensured
for all liboverrides after each recursive resync level, these pointer
can now be null in the code cleaning up unused liboverrides.

Note that they could already be null before (in isolated override case),
but this case is very rare in practice.
2025-08-13 10:05:36 +02:00
YimingWu
16820b7dc6 Cleanup: LineArt: Bump version when doing thickness versioning
Version should always be bumped when doing changes to DNA, not combined
with other changes in the latest version.

The versioning code was introduced in 6f57268e9a .

Pull Request: https://projects.blender.org/blender/blender/pulls/144472
2025-08-13 06:39:59 +02:00
Sean Kim
34dea22b3f Cleanup: Remove deprecated toggle_brush field
Follow up to c89baaf768cab4dbb52a20969062325a08574d90

Pull Request: https://projects.blender.org/blender/blender/pulls/139906
2025-08-13 02:42:32 +02:00
Campbell Barton
0d1bece64b Help text: support extracting Vulkan & OpenGL args even when disabled
Support extracting arguments for all GPU backends irrespective
of the build argumetns.
2025-08-13 09:26:02 +10:00
clankill3r
72bda4eaee PyDoc: added missing screen parameter
Ref !144452
2025-08-12 22:42:03 +00:00
nutti
d901c95502 Fix: typo in mathutils.Vector doc-string
Ref !143771
2025-08-12 22:41:59 +00:00
Campbell Barton
494bb557fb Fix: error referencing a temporary variable
Correct error from [0] which held a reference to a temporary variable.
Also improve comment wording.

[0]: d278e7d424
2025-08-13 08:39:34 +10:00
Sean Kim
bf7c8f1ef3 Fix #144281: Missing redraw for Unified Paint Setting toggles
Pull Request: https://projects.blender.org/blender/blender/pulls/144398
2025-08-12 23:41:47 +02:00
Sean Kim
84c2634d6b Fix #144426: Vertex Paint falloff doesn't work
Introduced with ba291976b2

The above fix was incomplete; while it resulted in the correct value
being applied for the buffer, the actual blending and application of the
color with the existing mesh values was incorrect.

Pull Request: https://projects.blender.org/blender/blender/pulls/144465
2025-08-12 23:31:38 +02:00
Namit Bhutani
e4c763ff23 Fix: Sculpt spatial reodering crash after recent fix
Caused by #144388.
Move the for loop such that isolated vertices are processed
in the end, after the face groups are done processing their vertices.

Pull Request: https://projects.blender.org/blender/blender/pulls/144463
2025-08-12 23:09:07 +02:00
Sean Kim
1b2856f566 Cleanup: Remove python references to deprecated brush types
Missed in 922e40eefe

Pull Request: https://projects.blender.org/blender/blender/pulls/144399
2025-08-12 21:37:53 +02:00
Jesse Yurkovich
0240a1f32f Cleanup: CMake: Modernize bf_intern_openvdb dependencies
This follows the other CMake "modernization" commits, this time for
`bf_intern_openvdb` and the OpenVDB dependency itself.

The difference with this one is that `intern/openvdb` becomes an
"optional" dependency itself. This is because downstream consumers often
want to include this dependency rather than openvdb directly, so this
target must also be optional. Optional, in this case, means the target
always exists but may be entirely empty.

Summary
- If you are using BKE APIs to access openvdb features, then use the
  `bf::blenkernel` target
- If you are only using `intern/openvdb` APIs then use the
  `bf::intern::optional::openvdb` target (rare)
- For all other cases, use the `bf::dependencies::optional::openvdb`
  target (rare)

context: https://devtalk.blender.org/t/cmake-cleanup/30260
Pull Request: https://projects.blender.org/blender/blender/pulls/137071
2025-08-12 21:26:38 +02:00
Harley Acheson
42b6c7f804 Fix #132460: Remove File Browser Path Validation
This PR removes validation of saved bookmarks and system paths in File
Browser. The act of checking validity of a path can result in a timeout
that can last many seconds. Blender will have a very long startup time
if any such items are disconnected, invalid, offline, or removed. Even
if these paths are not used during the Blender session, like network
shares used only at work, web storage for some non-Blender use, a
shortcut to a USB drive, etc. Items will not be greyed out, and
clicking on one will result in a timeout _at that time_ but this seems
like expected behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/138218
2025-08-12 21:22:52 +02:00
Bastien Montagne
9be8f3d430 Benchmark: Improve RNA performance tests flexibility.
Make registered py-defined property tests more flexible, by allowing to
pass the property type as an argument.

And add basic such tests for Bool and String types.
2025-08-12 20:11:11 +02:00
Jacques Lucke
cea51d82be Refactor: Geometry Nodes: remove bNodeSocketType::geometry_nodes_cpp_type
This type was the same for every socket type supported by Geometry Nodes.
It's always `SocketValueVariant` now. Therefore, it was unnecessary to s
tore an explicit pointer to it.

Pull Request: https://projects.blender.org/blender/blender/pulls/144458
2025-08-12 20:09:52 +02:00
Mohamed Hassan
ce7759bae6 Compositor: Removing Sun Beams node
This patch removes the Sun Beams node since it is now part of the
Glare node. It is versioned using a Glare node of Sun Beams type.

Pull Request: https://projects.blender.org/blender/blender/pulls/144110
2025-08-12 19:53:54 +02:00
Jacques Lucke
69cf5e1ad7 Refactor: Geometry Nodes: use SocketValueVariant to get value from socket
This moves us closer to removing `geometry_nodes_cpp_type` which is
always `SocketValueVariant` now.

Pull Request: https://projects.blender.org/blender/blender/pulls/144445
2025-08-12 19:11:05 +02:00
Falk David
5f721c2e2e Fix: VSE: Scene Strip template ID "new" function not working
In the `Strip` panel in the scene template ID, the "new/duplicate"
operator would duplicate the active scene in the window instead
of the selected scene in the strip.

Pull Request: https://projects.blender.org/blender/blender/pulls/144453
2025-08-12 18:55:26 +02:00
Hans Goudey
cfb8696a73 Curves: Add cyclic curve offsets cache
This will be used to simplify the rendering of cyclic curves and improve
the performance. The cache is just a prefix sum of the cyclic attribute.

Pull Request: https://projects.blender.org/blender/blender/pulls/144444
2025-08-12 18:21:52 +02:00
Christoph Lendenfeld
809f7abfb6 Fix #144364: Incorrect RNA update function called for Bones
The issue was that an rna function was called on `Bone`
that expected an `EditBone`. Because the pointer was just casted,
this means it would write into wrong bytes on the struct.

Caused by a43359eb88

Pull Request: https://projects.blender.org/blender/blender/pulls/144447
2025-08-12 17:40:08 +02:00
Leon Schittek
520eaa76ff Fix #144168: Ignore mouse event when creating search popups
When search popups are created at the bottom of the screen, they are
repositioned to stay within the bounds of the main window. This
can cause the cursor to hover over one of the search results, causing
it to become active.

Since some searches put recently searched items at the top of the
result list, the first search result should always be active by default.

This is achieved by ignoring the mouse event after the creation of
the popup by checking if the mouse has actually moved.

Pull Request: https://projects.blender.org/blender/blender/pulls/144296
2025-08-12 17:33:26 +02:00
clankill3r
ac962c02f6 Fix: PyDocs: typo fix in example
by -> be

Pull Request: https://projects.blender.org/blender/blender/pulls/144448
2025-08-12 17:20:04 +02:00
Brad Smith
501df52b53 Fix: Build failure on riscv64 platform
Use `__LP64__` consistently for 64-bit platform detection and simplify
the checks a bit. The amd64, aarch64 and powerpc64 checks are covered
by `__LP64__`.

Pull Request: https://projects.blender.org/blender/blender/pulls/143679
2025-08-12 17:05:25 +02:00