Commit Graph

150077 Commits

Author SHA1 Message Date
Sebastian Parborg
e4aa758d70 Fix #137346: IME input getting lost when using Wayland
Our IME input system relied on passing around pointers to global variables.
However this will not work as the Wayland input handling is multithreaded so the content of the global variable would change while the event loop were reading the data.

Pull Request: https://projects.blender.org/blender/blender/pulls/138871
2025-05-16 14:21:06 +02:00
Clément Foucault
8ac5940e33 GPU: Add GL_ARB_clip_control support to the GL backend
This adds support for the extension and always
set the clip state value to 0..1 to align with vulkan
and metal. Moreover this is needed for the Reverse Z
implementation.

Note that this is a OpenGL 4.5 feature and is not
required to start Blender. So there must still be
a fallback path for now.

Rel #138898

Pull Request: https://projects.blender.org/blender/blender/pulls/138941
2025-05-16 13:53:36 +02:00
Christoph Lendenfeld
45240026a2 Refactor: Remove unused bone flag
No functional changes intended.

This removes the `BONE_HIDDEN_PG` flag for Bones.
It was never set, only read so it had no effect.

Part of #138482

Pull Request: https://projects.blender.org/blender/blender/pulls/138802
2025-05-16 13:43:56 +02:00
Habib Gahbiche
1035a7c463 Cleanup: Order nodes alphabetically
Pull Request: https://projects.blender.org/blender/blender/pulls/138972
2025-05-16 12:35:05 +02:00
Jeroen Bakker
6f84eb6d30 Vulkan: Report on all enabled optional features and extensions
Report on all enaled optional features and extensions of the selected
device.

Use `blender --debug-gpu --log-level 2`.
2025-05-16 12:17:59 +02:00
Jeroen Bakker
abede0e682 Fix: Vulkan: Incorrect vertex fetch mode
Issue introduced by 91627b3d47
When reading floats as floats they were actually read as ints.

Pull Request: https://projects.blender.org/blender/blender/pulls/138969
2025-05-16 11:21:52 +02:00
Jeroen Bakker
729f6290b8 Fix: Draw: Asserts due to recent changes
cbcf421db7 could raise asserts as it
didn't use the `!is_empty()` function to test if the name is set.

Pull Request: https://projects.blender.org/blender/blender/pulls/138970
2025-05-16 11:20:53 +02:00
Clément Foucault
2ce71fca18 GPU: Shader Preprocess: Add support for template inside namespaces
And also support for template definition on single line.
2025-05-16 11:01:07 +02:00
Sybren A. Stüvel
82699dfe01 Fix #138733: Driver to control GP layer visibility is invalid
Fix an issue where a driver on the grease pencil layer visibility was not
considered to be animating the visibility.

Pull Request: https://projects.blender.org/blender/blender/pulls/138944
2025-05-16 10:46:06 +02:00
Christoph Lendenfeld
0c10ada0cb Refactor: typedef for Shape Key enums
No functional changes intended.

This adds `typedef`s for the enums used by Shape Keys.
Doing so makes it clear what kind of values are stored
under the `flag` and `type` fields.

Also adding/cleaning-up comments that various functions
in `key.cc` can be changed to a `switch/case`.

In preparation for #136838

Pull Request: https://projects.blender.org/blender/blender/pulls/138595
2025-05-16 10:14:29 +02:00
Jeroen Bakker
606d24d88a Fix #138942: Vulkan: Use different scaling on first swapchain
First time a swap chain is created an incorrect resolution can be
reported back by the driver as the window is still initializing. We
stretch the swap chain to cover to reduce a black line rendering in top
of the window (due to content flipping). Any subsequent frame will not
do stretching to reduce artifacts when resizing the window.

Pull Request: https://projects.blender.org/blender/blender/pulls/138964
2025-05-16 08:47:04 +02:00
Sean Kim
1232d64681 Sculpt: Enable pen tilt without experimental option
At this point, with pen tilt functionality having received the following
changes recently:
* Consistency between platforms for what pen tilt values represent
* Inactive cursor visualization
* Invertable per-brush strength

The majority of the work that remains is wider testing and addressing
per-device issues, thus it makes sense to make this option available in
release builds.

By default, no brushes packaged with Blender have a non-zero Tilt
Strength, making this option opt-in by default.

The following brushes support this option:
* Draw
* Draw Sharp
* Flatten
* Fill
* Scrape
* Plane
* Clay Strips

With a non-zero Tilt Strength value on the brush, the normal of the
brush plane is tilted in the same direction as the user's pen, where a
perpendicular orientation for the pen matches the behavior with a Tilt
Strength of 0.

Resolves #82877

Pull Request: https://projects.blender.org/blender/blender/pulls/137574
2025-05-16 01:44:37 +02:00
Sean Kim
a69bb2a7ce Refactor: Replace Paint brush density_seed storage
* Changes the field to be an optional<float> so that initialization is
  more clear
* Removes usage of `SCULPT_stroke_is_first_brush_step`

Pull Request: https://projects.blender.org/blender/blender/pulls/138955
2025-05-15 23:10:05 +02:00
Sean Kim
ab54e09556 Refactor: Move and replace Pose SCULPT_stroke_is_first_brush_step
* Localizes code to the pose.cc file
* Removes external visibility of no longer needed calls

Pull Request: https://projects.blender.org/blender/blender/pulls/138951
2025-05-15 23:07:40 +02:00
Sean Kim
563a00bd3f Refactor: Replace Cloth SCULPT_stroke_is_first_brush_step check
Pull Request: https://projects.blender.org/blender/blender/pulls/138950
2025-05-15 23:04:55 +02:00
Sean Kim
f831e211f4 Refactor: Move and replace Face Set SCULPT_stroke_is_first_brush_step
* Shift call to the Draw Face Set brush implementation as it is
  irrelevant for other brushes.
* Instead of checking for the first brush step, check to see if the
  value is still `SCULPT_FACE_SET_NONE`.

Pull Request: https://projects.blender.org/blender/blender/pulls/138949
2025-05-15 23:03:42 +02:00
Sean Kim
0514789737 Refactor: Replace Enhance Details SCULPT_stroke_is_first_brush_step
Pull Request: https://projects.blender.org/blender/blender/pulls/138948
2025-05-15 22:58:39 +02:00
Harley Acheson
755336b17f Fix #138832: Panel Category Background Out By One Pixel
The drawing of the background of panel categories is out by one pixel,
but was covered by the area borders until recently. This PR just draws
one pixel more to the edge.

Pull Request: https://projects.blender.org/blender/blender/pulls/138956
2025-05-15 22:42:23 +02:00
Guillermo Venegas
89a3478e35 Refactor: UI: Replace uiItemMenuF and uiItemMenuFN with uiLayout methods
This converts the public `uiItemMenuF` and `uiItemMenuFN`
functions to an object oriented API (an `uiLayout::menu_fn`
and `uiLayout::menu_fn_argN_free` respectively), following
recent uiLayout changes.

Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/138902
2025-05-15 21:26:49 +02:00
Jacques Lucke
5a449439ef Refactor: BLI: simplify compute context hash generation and make it lazy
Currently, there was a lot of boilerplate to compute the compute context hash.
Now, the complexity is abstracted away to make it a simple function call.

Furthermore, this makes the compute context hash generation lazy. The goal here
is to make it very cheap to construct the compute context hash in the first,
while making it a little bit more expensive (still quite cheap overall) to
access the hash when any data has to be logged. This trade-off makes sense when
we want to pass the compute context to more lower-level places in order to be
able to create better error messages with more contextual information. For
example, we'd want to create error messages during multi-function evaluation
which happens during field evaluation within a node.

Pull Request: https://projects.blender.org/blender/blender/pulls/138912
2025-05-15 21:18:23 +02:00
Andrew Marshall
000c787059 Fix: Cycles film exposure maximum is too low
The previous value was incorrectly assuming this is 2^exposure, but it
is a simple multiplier.

Specifying large film exposure values is useful as it affects the raw data and
thus results in the same color values available in EXR, Viewer, and
Compositor, whereas using Color Management exposure is not reflected in EXR
exports, resulting in unusably low values. Using film exposure remedies that.

Pull Request: https://projects.blender.org/blender/blender/pulls/138850
2025-05-15 20:58:28 +02:00
Jacques Lucke
734e3c5589 Spreadsheet: support double click to fit column width
This implements a new operator that automatically fits the width of a column to
its content. It's triggered by double-clicking on the column edge in the header
row. This is common functionality in other spreadsheet software.

Pull Request: https://projects.blender.org/blender/blender/pulls/138924
2025-05-15 20:57:37 +02:00
Jacques Lucke
c157fecc4e Nodes: support searching for frame/seconds to find Scene Time node
Previously, one had to search for "Time" to get the Scene Time node which
provides access to the current frame and second. Intuitively I often start
searching for "frame" or "seconds" instead and only later remember what I
actually have to search for.

This patch improves the UX by allowing to create a Scene Time node by searching
for "frame" or "seconds" directly. This works in Geometry Nodes and the
compositor.

Pull Request: https://projects.blender.org/blender/blender/pulls/138927
2025-05-15 20:56:33 +02:00
Jacques Lucke
578f935170 Nodes: support changing attached frame while transforming nodes
Currently, removing a node frame a frame is rather annoying. The `alt+P`
shortcut is hard to reach and probably not very intuitive. Furthermore, often
one only notices that one wants to remove a node from a frame after starting to
move the node. So one would have to put the node back down, detach it from the
frame and then start moving again.

This patch simplifies this entire process by adding a new shortcut that can be
used while dragging nodes. When `F` is pressed, the selected nodes are detached
from their parents. Alternatively, if the nodes are detached already, they may
be attached to the frame under the cursor.

Pull Request: https://projects.blender.org/blender/blender/pulls/138650
2025-05-15 20:54:29 +02:00
Hans Goudey
cbcf421db7 Cleanup: Draw: Use StringRef for attribute names
Avoid the need to measure string length potentially many times.
2025-05-15 14:53:51 -04:00
Jacques Lucke
8ec093a2d8 Nodes: new operator to simplify adding named frames
Currently, the steps required to add a named frame in the node editor are quite
cumbersome:
* Press ctrl+J, which is hard to reach.
* Press F2, to rename.

This is bad, because frames are a key part of making node trees understandable.
Therefore, we should lower the barrier to adding them as much as possible.
Additionally, named frames help significantly more with readability. Therefore,
it's good to lower the barrier to adding those even more. Of course it's still
possible to click in empty space to avoid having to give a frame a name.

This patch adds a new operator to join nodes in a named frame. When triggered,
it adds the frame and automatically opens the rename menu to set the name.

Keymap changes:
* Remove `ctrl+J` which was creating a frame without label.
* Move existing functionality of `F` key to `J` key
  (including `shift+F -> shift+J`).
* Use `F` for this new operator to create a named frame.

Pull Request: https://projects.blender.org/blender/blender/pulls/138390
2025-05-15 20:51:54 +02:00
Hans Goudey
760cf70d63 Draw: Use VectorSet for generic attribute requests
Replace `DRW_Attributes` with a VectorSet of std::string. The max number of
attributes is still the same. The inline buffer size is 4, and std::string's inline
buffer is smaller than the previous char array size of 64, but it seems
reasonable to save those optimizations for shorter attribute names and
fewer attributes. In return we significantly decrease the size of the batch
caches, simplify the code, and remove the attribute name length limit.

I observed roughly an 8% increase in the 30k cube objects file, a change from
12 to 13 FPS. I'm guessing this is mostly because `VectorSet<std::string>` is
smaller than `DRW_Attributes`.

Pull Request: https://projects.blender.org/blender/blender/pulls/138946
2025-05-15 20:43:31 +02:00
Sergey Sharybin
a3748b549b Fix #138868: Slow start up on when using certain OCIO config
Regression caused by #138433

Somehow the lazy nature of the is_linear and is_srgb got lost in
the refactor and the fields were greedily initialized on startup
and it is not a cheap operation.

Pull Request: https://projects.blender.org/blender/blender/pulls/138945
2025-05-15 20:26:02 +02:00
Sean Kim
906a27bdb2 Fix #138887: Clay Strips brush ignores automask settings
Caused by 33bef53c3e

The change to return an empty IndexMask early from the clay strips brush
breaks some previous assumptions about data flow. To fix this, and
improve the overall resilance of related code to such changes, avoid
checking for a specific stroke step when initializing this data and
delay it in processing until needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/138921
2025-05-15 20:11:42 +02:00
Clément Foucault
97a1e1501b DRW: Add a new GPU context for rendering preview jobs
This avoid stalling the viewport when a preview job is running.
This is because both were fighting for the same GPU context.

This doesn't remove the blocking but allows to remove it using #136991.

Pull Request: https://projects.blender.org/blender/blender/pulls/138882
2025-05-15 20:09:37 +02:00
Brecht Van Lommel
a94a911e10 Fix: Slow USD import with certain OpenColorIO configs
As evidenced by #138868, checking all colorspaces to see if they are sRGB
can be very slow, due to loading all LUTs into memory. Instead use a simpler
check by a list of names only, which is still better than the hardcoded
single name used in Blender 4.4.

Ideally recent configs will use the ColorInterop Forum alias so we can
find the sRGB colorspace reliably.
2025-05-15 19:33:37 +02:00
Hans Goudey
011b3f5cb3 Cleanup: Remove unused field from mesh draw batch cache 2025-05-15 13:14:47 -04:00
Michael B Johnson
af0cfcb01c MaterialX: Export Principled BSDF as OpenPBR Surface
Switch from Standard Surface to OpenPBR as the exported MaterialX surface,
since this is the new standard more renderers are adopting and it more closely
matches the Principled BSDF implementation.

Anisotropy support is improved though still not quite the same, as formulas
are different. Nodes are generated to apply anisotropic rotation to the
tangent vector, as there is no corresponding parameter in OpenPBR.

Fixes #138164

Authored by Apple: Lee Kerley

Pull Request: https://projects.blender.org/blender/blender/pulls/138165
2025-05-15 19:13:36 +02:00
Ray Molenkamp
67ba636006 deps: Fix windows build.
Broken by PR#134221

- Couple of missing deps
- Windows is not happy with -J when building python deps
as multiple processes will try to write to the same .pdb
- Wrong .lib file name for the zstandard python module.
2025-05-15 09:19:29 -06:00
Sybren A. Stüvel
54a7b0bc61 Fix: crash when determining RNA data path of driver F-Curve
The F-Curve RNA path function assumed that the F-Curve would be owned by
an Action, which is not the case for drivers, NLA control curves, and
potentially other "free-floating" F-Curves.

This is now checked for, and if the owner is not an Action, the function
refuses to produce a data path. In the future this could be extended to
search through the aforementioned places as well.
2025-05-15 16:32:15 +02:00
Hans Goudey
b13bdcfaeb Fix #138910: Crash with sculpt mode and "Texture" shading type
Using the wrong `std::string` constructor through an alias, oops..
2025-05-15 10:13:34 -04:00
Habib Gahbiche
df6e65dd93 Compositor: add viewer node to the default node tree
Users almost always need a viewer node, so add one to the default node
tree.

Note that the backdrop is already enabled by default, so the backdrop
image will be visible as soon as a render is available (no need to
manually add viewer node or click `cltr+shift+LMB` to show a backdrop
image.

Pull Request: https://projects.blender.org/blender/blender/pulls/138890
2025-05-15 16:08:19 +02:00
Hans Goudey
91627b3d47 GPU: Remove int float fetch mode combination
This commit finishes removing the uses of the integer to float
vertex buffer fetch mode. Previous commits noted below already started
that process. The last usage was geometry attributes. Now integers are
converted to floats as part of the existing upload process.

The change makes the Vulkan vertex buffer type conversion unused, so
it's removed. That's nice because Vulkan vertex buffers go from 1040 to
568 bytes in size and have significantly less overhead on creation.

Related:
- 153abc372e
- 1e1ac2bb9b
- 617858e453

Pull Request: https://projects.blender.org/blender/blender/pulls/138873
2025-05-15 15:29:12 +02:00
Habib Gahbiche
eaa1e34eca Compositor: improve default node position
The node tree is partially covered by default. This patch updates the
position of the nodes to a better default.

Pull Request: https://projects.blender.org/blender/blender/pulls/138889
2025-05-15 15:13:19 +02:00
Alaska
0d6a79a8f3 Cycles: Use CUDA 11 to compile PTX kernels
This commit makes it so CUDA 11 is used to compile the compute_75
PTX CUDA kernels.

This is being done because PTX kernels have much stricter minimum
driver requirements than standard kernels, so using the latest CUDA
toolkit to compile PTX kernels can result in the PTX kernels being
inaccessible to users with drivers that are only a few months old.

This is important because in some situations, it's either impossible
(E.g. Renting certain cloud services), or difficult to update the GPU
drivers on some machines. And we want to make sure the PTX kernels
are usable by as many people as possible

Original Author: Sergey Sharybin <sergey@blender.org>

Pull Request: https://projects.blender.org/blender/blender/pulls/138879
2025-05-15 15:00:47 +02:00
Pratik Borhade
3c726aaa6b Fix: Grease Pencil: Check lock status in assign/remove vgroup API
Skip editing vertex group from `vertex_group_assign/remove` API call
of GreasePencilDrawing, when vgroup is locked. Noticed this while
reviewing !127216

Pull Request: https://projects.blender.org/blender/blender/pulls/138932
2025-05-15 14:53:44 +02:00
Nathan Vegdahl
8a984f4f4e Anim: Add "replace" mix mode to the Action Constraint
The available mix modes on the Action Constraint only allowed
*combining* the Action's transforms with the input transforms, but
unlike most other constraints lacked a way to completely
override/replace those transforms.

This PR adds a "Replace" mix mode to the Action Constraint, bringing it
in line with most of the other constraints already in Blender.

![action_constraint_replace_mode_screenshot.png](/attachments/51fb09d6-0a87-42dc-a75e-9ae81c856796)

----

Test file: [action_constraint_replace_mode.blend](/attachments/fc3417a8-b60a-4212-9840-5b59191e9ed9)

- The small bone at the top is the action constraint target (translating it right-left triggers the action constraint).
- Both two-bone chains are set up with action constraints.  The base bones of each chain additionally have a copy location constraint to the small sideways bone, placed before the action constraint in their constraint stack.
- The chain on the left has the default mix mode, which allows you to manipulate the bones on top of what the action constraint does, and allows the copy location constraint on the base bone to work.
- The bones on the right have the new "Replace" mix mode, and therefore manipulating them does not affect the final constrained transformation, and the copy location on the base bone is overridden by the action constraint.

Pull Request: https://projects.blender.org/blender/blender/pulls/138316
2025-05-15 14:30:01 +02:00
Jacques Lucke
e4e49e1634 Nodes: don't jump viewer node if it's still visible
The goal is to make the viewer node jump less often because each unnecessary
jump feels annoying. Previously, we already had a heuristic that would disable
the jumping if the new viewer location was further away than the old one. Now
the viewer never jumps when it's still visible in the node editor and already to
the right of the node-to-view.

As a byproduct this also fixes an issue where the initial viewer position does
not work properly, because the node does not have known draw-bounds yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/138744
2025-05-15 12:11:07 +02:00
Jeroen Bakker
1c72dca726 Cleanup: Remove unused code 2025-05-15 12:00:09 +02:00
Jeroen Bakker
3b3cab471a Fix #138843: Vulkan: Swapchain issues
- Reduce artifacts during resizing to also recreate the swapchain
  when acquire image is suboptimal
- Do not stretch when backbuffer and swapchain have a different size

Pull Request: https://projects.blender.org/blender/blender/pulls/138925
2025-05-15 11:57:44 +02:00
Falk David
c07dfca81a Cleanup: Grease Pencil: Simplify get_bone_mat utility function 2025-05-15 11:41:35 +02:00
Gianluca Giampuzzo
f4117f7146 Fix: Rigify Cat metarig Palm.002 roll misorientation
Fix misorientation on palm.002 both L/R from 3.1416 to 0.0004.

The new value is also used by other palms in other rigs.

Fixes: blender/blender-addons#104772
Co-authored-by: techmadentertainment <tech@madentertainment.it>
Pull Request: https://projects.blender.org/blender/blender/pulls/138124
2025-05-15 11:40:59 +02:00
Jeroen Bakker
74e244d9b7 Fix: Vulkan: memory leak when rendering animations
Always discard the context discard pile even when not submitted
When rendering animation it is not guaranteed that the submission
flag will ever be set.
2025-05-15 09:06:37 +02:00
Jeroen Bakker
4365a0015f Vulkan: Add render discard pile to debug
Recently we introduced a new discard pile, but it wasn't
reported inside the debug information.
2025-05-15 09:06:37 +02:00
Omar Emara
499dcc3ae2 Compositor: Avoid clamping after HSVA conversion
This patch avoid clamping HSVA colors after being combined using a
Combine HSVA node in the GPU compositor. This is consistent with the CPU
compositor and other node editors.
2025-05-15 09:58:32 +03:00