Commit Graph

123324 Commits

Author SHA1 Message Date
Jacques Lucke
f79896f5b9 Refactor: Nodes: unify optional-label handling for sockets
Previously, the input socket drawing code did not cover all cases with required
and optional labels for all socket types. E.g. menu sockets were never drawn
with label (unless there was some error) regardless of whether `optional_label`
was set or not.

This patch unifies the handling of this flag, i.e. all socket types support
drawing with and without label. This is also required before we can expose this
functionality to users.

Since all menu inputs had optional labels by default before, this patch makes
labels optional explicitly by changing the declaration of all the nodes. This
way, there is no expected user-visible change with this patch.

Pull Request: https://projects.blender.org/blender/blender/pulls/146935
2025-09-28 19:38:14 +02:00
Jacques Lucke
305304e16c Fix: Nodes: socket active status affects other sockets
Each socket is generally drawn into a separate row like in `draw_node_input`.
However, this row was not created when a socket had a custom drawing function.

This caused all properties of the Index Switch node to be grayed out in the
sidebar.
2025-09-28 17:46:23 +02:00
Jacques Lucke
469a70dba9 Cleanup: Nodes: rename hide_label to optional_label internally
The new name better represents the actual meaning of the value.
"hide_value" was wrong because it didn't even hide the label in
many cases.

This property just indicates that the input is still understandable
even if the label is not drawn. It's up to the drawing code to make
the final decision whether the label should be drawn or not. This
option just gives it the opportunity to skip the label if that results
in a cleaner UI.
2025-09-28 17:30:21 +02:00
Jacques Lucke
1f489ea31a Cleanup: Nodes: remove some runtime socket flags
This removes the `SOCK_NO_INTERNAL_LINK`, `SOCK_COMPACT` and `SOCK_HIDE_LABEL`
flags from `eNodeSocketFlag`.  Those are not necessary, because they just store
a copy of the data that is stored in the socket declaration and are thus
effectively runtime data.

None of these flags were exposed to Python, so there is no breakage expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/146925
2025-09-28 17:18:49 +02:00
Jacques Lucke
6ad9bf8af8 Fix #146521: Evaluate Closure node without closure behaves incorrectly
This was an oversight in the initial implementation. If there is no closure,
the node should behave like if it's muted, so it passes through inputs to
outputs when the names are equal. This is the same behavior as in
Geometry Nodes.
2025-09-28 16:24:48 +02:00
Jacques Lucke
2d206f2927 Fix #146459: wrong warning that input does not support fields
The issue was that the Separate XYZ node was linked to something
expecting a field and something expecting a single value. This
incorrectly resulted in the input getting a field data requirement,
instead of single-value.
2025-09-28 16:14:29 +02:00
Jacques Lucke
99f84a8987 Fix #146345: assert when tracing closure value through nested zones
There were two issues:
* Missing null checks when the compute context of a socket can't be detected
  statically.
* Incorrect parent compute context detection for closures. The tricky aspect is
  that closures can be evaluated in a different compute context from where they
  are created.

Pull Request: https://projects.blender.org/blender/blender/pulls/146922
2025-09-28 15:39:17 +02:00
Jacques Lucke
e3e7bd670a Nodes: simplify rule for output visibility inferencing
#140856 added support for output visibility inferencing. Internally, it relied
on checking whether the output value of a group is a constant fallback value,
while on the user level this is mainly controlled with the new `Enable Output`
node. While it works, there are some unexpected behaviors when the user happens
to output the fallback value without expecting the socket to be hidden.
Additionally, this approach required the output value to be inferenced, which
may trigger more evaluation than we'd want.

This patch better aligns the internal behavior with the user-expected behavior.
This is achieved by not relying on any specific fallback values. Instead, for
each output socket it does an explicit check for whether it is connected to an
Enable Output node. Then the Enable input of that node is computed and the
output visibility is derived from that directly. This is still fully composable
with nested node groups etc. It also allows extending this check in the future
to e.g. automatically disable certain anonymous attribute outputs when the
corresponding output geometry is unused.

Note, since only changes in menu sockets are allowed to change visibility by
convention, this also applies here. Same as before.

The main design on the user-level with the Enable Output node is still exactly
the same as before.

Pull Request: https://projects.blender.org/blender/blender/pulls/146918
2025-09-28 13:52:52 +02:00
Jesse Yurkovich
48b2f472f3 Fix #146910: Update path for Smooth by Angle asset
Pull Request: https://projects.blender.org/blender/blender/pulls/146911
2025-09-28 13:19:52 +02:00
Campbell Barton
182d8ef142 Docs: add doc-strings for UV sticky selection 2025-09-28 16:03:29 +10:00
Campbell Barton
1453871dea Cleanup: rename UV selection options
- Remove the `SI_` prefix from sticky UV selection options.
  This was left in from when the option was part of "SpaceImage"
  which is no longer the case.
- Use *_SELECT_SYNC, _SELECT_ISLAND (matching RNA identifiers).
- Use "VERT" abbreviation.
2025-09-28 15:15:19 +10:00
Pratik Borhade
8de2e6f9fb UI: Gray out labels for non-editable linked items
Similar to !145387, disable layout when rna property is non editable.
Let the widget code handle the theme of the label in
front of the non-editable property. Also do it separately inside
`v3d_object_dimension_buts` for transform properties of N-panel

Resolves #146290

Pull Request: https://projects.blender.org/blender/blender/pulls/146565
2025-09-28 07:06:21 +02:00
John Kiril Swenson
8e934e7af0 UI: Reduce text jumping for dynamic length values
Operators that use BKE_unit_value_as_string results in numbers with a
changing fractional part which frequently jumps around.

The issue became more noticeable with centrally aligned status text,
see !139507.

Address this by disabling stripping of trailing zeros for:

- `translate_dist_to_str`
  (used by object translation, extrude, rip region).
- Mesh bevel
- Inset faces
- Shrink/fatten
- Eyedropper depth sampling (e.g. in camera DOF)

Ref !140790
2025-09-28 12:36:01 +10:00
Jacques Lucke
8b05fb62f0 Fix: Nodes: prioritize tooltip for input socket for inlined sockets
Previously, the tooltip of the output socket was shown when hovering
over the socket value in a node. This was misleading because the hovered
value is actually the input.

The output tooltip is still accessible by hoving the output socket shape.
2025-09-27 23:12:32 +02:00
Jacques Lucke
3338e7d70e Fix: Nodes: reroute nodes should always use circle shape
This was accidentally changed before when the new socket shape
inferencing was introduced.
2025-09-27 23:02:13 +02:00
Jacques Lucke
056dafffb3 Fix: Nodes: avoid creating invalid internal link when initializing closure 2025-09-27 22:58:30 +02:00
Jacques Lucke
ee5e14e5fe Fix: Nodes: forbid muting Group Input nodes
This is already the case for Group Output nodes. It was an oversight
not to do the same for inputs.

Also see https://archive.blender.org/developer/D13364.
2025-09-27 22:52:29 +02:00
Jacques Lucke
221c16f2f0 Nodes: improve descriptions in menu switch node 2025-09-27 22:40:31 +02:00
Jacques Lucke
22fb036e46 Fix: Nodes: incorrect internal links in muted Menu Switch node
Previously, the new recently added boolean outputs were all
internally linked to the first input, but they should not have an
internal link at all.
2025-09-27 22:33:22 +02:00
Jacques Lucke
1fd6d9263c Nodes: menu switch labels in index switch nodes
The goal here is to simplify working with the common pattern where a Menu Switch
node is followed by an Index Switch node. This is achieved by detecting this
pattern and drawing the item names from the menu switch node in the index switch
node.

This slightly refactors the custom socket drawing callback to make it easier for
it indirectly call the default drawing function.

Pull Request: https://projects.blender.org/blender/blender/pulls/145710
2025-09-27 21:49:47 +02:00
Jacques Lucke
ce85d4cbaf Shader Nodes: improve preservation of repeat zones in shader nodes inlining
These are some cleanups and fixes extracted from #146068. Preserved repeat
zones are not used by any render engine yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/146890
2025-09-27 21:02:29 +02:00
Hans Goudey
3bed61b33c Fix #146497: Geometry Nodes: Don't display deprecated "Texture" socket type
Ideally we'll remove this socket type at some point,
but for now we should make sure not to display it.

Pull Request: https://projects.blender.org/blender/blender/pulls/146502
2025-09-27 19:52:18 +02:00
Hans Goudey
eef9a1b9ae Geometry Nodes: UV tangent node
This node outputs tangent values for face corners. There are two methods:
- **Exact** is the same MikkTSpace calculation used elsewhere in Blender.
- **Fast** (from #131308) is over 4x faster, and useful in many of
  the same situations, though not necessarily tangential to the surface.

The reason to include both methods is that there are use cases where the
quality of the tangents don't matter (though the results are actually very
similar visually), we just need some continuous values across faces.

Pull Request: https://projects.blender.org/blender/blender/pulls/145813
2025-09-27 18:57:18 +02:00
Jacques Lucke
986219bf37 Geometry Nodes: support searching for string and data-block values
This extends the ctrl+F search to also support searching for some socket values.
The original motivation for this came from the need to search for a Warning node
by its warning (instead of node name or label). However, I found this to be more
generally useful as it can also be used to search for places where e.g. certain
attribute names are used or where e.g. some object is referenced in an input
socket.

Pull Request: https://projects.blender.org/blender/blender/pulls/146882
2025-09-27 17:21:25 +02:00
Jacques Lucke
25c84e90df Nodes: add button in switch nodes to add inputs
This is a small usability feature to simplify adding additional inputs in the
Index Switch and Menu Switch nodes without having to go to the sidebar.

Technically, something similar can be done for other extend-sockets. However,
here it works best, because one does not have to choose the socket type. For
other inputs we could use a quick popup when pressing the button, but that seems
outside of the scope of this patch.

Later we might also want add the ability to remove existing inputs. But just
adding an icon for that doesn't work so well for socket types that have an input
property.

Co-authored-by: Brady Johnston <36021261+BradyAJohnston@users.noreply.github.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/145915
2025-09-27 16:47:54 +02:00
W_Cloud
4762425e94 Spreadsheet: Improve tooltip of matrix column
Currently, matrix attributes in the spreadsheet are difficult to inspect.

This PR  improves the readability of matrix tooltip, formatting it into
a column-aligned grid. Display floats with 6 significant digits
(3 for abs(x)<1e-4).

Pull Request: https://projects.blender.org/blender/blender/pulls/146207
2025-09-27 16:39:06 +02:00
Jacques Lucke
60a416bea4 Geometry Nodes: improve socket shapes for bundle and closure nodes
Previously, the closure and bundle nodes were a bit restrictive when it comes to
socket shapes. Especially the bundle nodes did not support customizing the
socket shape at all, so they always worked with dynamic values. This was
problematic, because it meant that e.g. the outputs of the Separate Bundle node
looked like they couldn't be used as single values, and other similar issues.

With this patch, the following is supported (a few aspects were supported before
but now it all fits better together): * Support manually selecting socket shapes
in Combine Bundle, Separate Bundle, Closure Input, Closure Output and Evaluate
Closure nodes. * Automatic inferencing of shapes in all these nodes, as long as
the socket shape is set to "auto". * A new "Define Signature" option can be
enabled in the nodes. If enabled, linked nodes will also sync the socket shapes
from that node. In the future, we also want to add support for naming the
signature.

Pull Request: https://projects.blender.org/blender/blender/pulls/145550
2025-09-27 14:58:43 +02:00
Nika Kutsniashvili
3e51b449be UI: Per-camera composition guide colors
Currently cameras composition guide colors are defined in theme, and not even by an individual
property. They follow 3D Viewport -> View Overlay color, which also defines many other things,
such as world origin cursor. By default it's black and it's difficult to change, because then other
things stand out. But using default black for composition guides is impossible.

This PR, instead, adds new Composition Guide Color property on camera, and uses it in camera view.
This not only fixes the issue mentioned above, but also allows different cameras in one scene to
have different overlay colors. This is very handy when you have, for example, two cameras, one of
which looks at the black corner, and another at the lit-up white one. Using a single black or white color
in this case makes the other one more difficult to see. Now, each camera can have its own color.

This PR only changes color for Composition Guides, and NOT for Safe Areas and sensor. Reasons are:
- It's important to differentiate between different concepts, having everything one color is distracting
- Safe areas are per-scene and shared with Sequencer preview. The camera shouldn't dictate color there.
I have separate plans about handling safe areas in the future.

Images in the PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/143788
2025-09-27 13:25:34 +02:00
Jacques Lucke
65f41c4119 Fix #146462: crash when shader output node is in zone 2025-09-27 13:13:22 +02:00
Jacques Lucke
22cdd58ad0 Fix: Geometry Nodes: assert when trying to view extend socket
This happened when e.g. ctrl+shift+clicking on the extend socket of the Group Input node.
2025-09-27 13:05:52 +02:00
Jacques Lucke
f9b993b977 Fix #146870: crash when trying to view non-existant data 2025-09-27 13:05:02 +02:00
Jacques Lucke
b186e60759 Nodes: support node output visibility inferencing
Currently, only the visibility of input sockets can be changed dynamically based
on other menu inputs. However, under some circumstances, it can also be useful
to hide certain outputs. For example, the built-in Curve Arc primitive node does
that.

This patch adds support for automatic detection of unused outputs. How to detect
unused outputs is less straight forward compared to inputs. This patch uses the
rule that an output is unused if it always outputs a "fallback value" (typically
0) irrespective of the currently used inputs. If the output is independent of
all inputs, it stays visible though.

There is a new small utility node called "Enable Output". It replaces a value
with it's fallback value unless it is disabled. This simplifies setting up
unused outputs. In theory, a normal switch node can also be used, but that is
less usable and the user will have to hardcode the fallback value for each type
which is not something that is explicitly exposed yet.

Supporting dynamic output visibility is also a prerequisite for exposing some
menu node options as sockets (e.g. in the Arc node).

Pull Request: https://projects.blender.org/blender/blender/pulls/140856
2025-09-27 10:09:48 +02:00
Jesse Yurkovich
4bb6513b7d Fix #146822: Ensure safe names are used for custom Alembic attributes
We did not sanitize the names used for UV maps or Color attributes when
exporting to Alembic. Names containing characters like ':' or '/' would
cause an unhandled exception from Alembic.

Pull Request: https://projects.blender.org/blender/blender/pulls/146867
2025-09-27 01:23:05 +02:00
Jesse Yurkovich
fd3da2004c Cleanup: Alembic: Remove some unused utility APIs
These have long been unused and they will not be used in the future
either.

Pull Request: https://projects.blender.org/blender/blender/pulls/146863
2025-09-27 00:08:46 +02:00
Brecht Van Lommel
ea43fa08e1 Cleanup: Improve formating of OCIO environment variable in the manual 2025-09-26 18:06:26 +02:00
Brecht Van Lommel
24ef6a3776 Cleanup: Improve formatting of command line argument in the user manual 2025-09-26 17:52:53 +02:00
Nick Alberelli
f7e7a5d09e Logging: Add argument to list all available categories
New `--log-list-categories` command line argument to list all available
logging categories. This improves documentation of logging, allowing
users to understand what logging categories are available for use. It is
also useful for developers to understand what logging categories already
exist before making a change.

Implemented using static initializers to register all logrefs on startup.

Ref  #141754

Pull Request: https://projects.blender.org/blender/blender/pulls/146456
2025-09-26 17:33:26 +02:00
Brecht Van Lommel
fff8d35e3f Color Management: Add option to control display emulation
In Render properties > Color Management > Display.

* Off: Directly output image as produced by OpenColorIO. This is not correct
  in general, but may be used when the system configuration and actual display
  device is known to match the chosen display.
* Automatic: Display images consistent with most other applications, to preview
  images and video for export. A best effort is made to emulate the chosen
  display on the actual display device.

The option is grayed out when the current OpenColorIO config and display/view
does not support emulation.

Ref #145022, #144911

Pull Request: https://projects.blender.org/blender/blender/pulls/146808
2025-09-26 17:05:18 +02:00
Sean Kim
9b5f23c7a3 BKE: Update default smooth curve preset
Updates the `CurveMapping` `CURVE_PRESET_SMOOTH` curve to more closely
approximate the smoothstep function (y = 3x^2 - 2x^3). This has the
implication of changing what happens when the curve is reset, but does
not change any existing curves already stored in blendfiles.

Notably, this change primarily affects three operators:
* brush.curve_preset (Mesh Sculpting)
* brush.sculpt_curves_falloff_preset (Curves Sculpting)
* render.shutter_curve_preset (Motion Blur)

Pull Request: https://projects.blender.org/blender/blender/pulls/146710
2025-09-26 16:43:22 +02:00
Sean Kim
0e2316c2bc Paint: Disable pressure sensitivity for certain brushes
A subset of brushes behave as "anchored" brushes, in that they do not
apply to the surface continually underneath the cursor, but have a
starting point and then are influenced by the mouse movement. These
brushes behave oddly with tablet pressure sensitivity, as they cannot
modulate over the course of the stroke without causing odd behavior.

Currently, the pressure is only sampled at the very beginning of the
stroke, which makes it difficult to control intuitively. Further work
can be done to improve this behavior (e.g. D6603).

The full list of brush types affected is below:
* Grab
* Snake Hook
* Elastic Deform
* Pose
* Boundary
* Thumb
* Rotate
* Cloth with Grab deformation

Resolves #83697

Pull Request: https://projects.blender.org/blender/blender/pulls/146825
2025-09-26 16:41:01 +02:00
Sean Kim
9c7ace059a Refactor: Add name for curve map slope preset enum
Names the formerly anonymous enum as `CurveMapSlopeType`, converts it to
`enum class` and adds a specific backing type for the variable.

Pull Request: https://projects.blender.org/blender/blender/pulls/146840
2025-09-26 16:40:16 +02:00
Pratik Borhade
8e2efa554a Fix: Redraw anim side region when sliding shape key value
Sliding shape key value in dopesheet editor generates keymap but side
panel isn't updated unless we move mouse over it. It has been mentioned
in last Animation module meeting. Fix is to send a notifier from "value"
property whenever edited, this will be listened by `action_region_listener`
to redraw the side region

Pull Request: https://projects.blender.org/blender/blender/pulls/146835
2025-09-26 16:27:14 +02:00
Sebastian Parborg
fcc1502146 Cleanup: Remove the now unused lzma and lzo libraries from extern
LZO and LZMA has been unused in Blender since #141461

Pull Request: https://projects.blender.org/blender/blender/pulls/146842
2025-09-26 15:55:47 +02:00
Lukas Tönne
9aade6bd61 Fix #145762: Ensure a valid background value before pruning SDF grid
OpenVDB will throw an exception when trying to prune a SDF/Level-Set grid with a
negative background value.

The geometry nodes in this case are constructing a nominal SDF grid from a
generic "density" volume cube. The negative background value results from
processing the background value the same way as all other grid values in the new
field+grid math feature (`blender::nodes::process_background`).

Since any grid can be constructed with a negative background value we have to
check and correct this before calling the OpenVDB prune function.

Pull Request: https://projects.blender.org/blender/blender/pulls/146837
2025-09-26 15:26:22 +02:00
Sebastian Parborg
d86de2cde2 Fix #146640: Freeze when force cancelling a CLI render
When we directly call `exit()` from `sig_handle_blender_esc`, the
program will try to free up all static variables and terminate all
threads (and do some file handle cleanup).

The destuctor of the static sound `GlobalState` will hang if
`delayed_close_cv` is in use by other threads as it will wait for them
to let go of it before the destructor finishes.

To make sure that it can finish, the destructor now notifies all
potential threads that they should exit.

Pull Request: https://projects.blender.org/blender/blender/pulls/146665
2025-09-26 14:36:35 +02:00
Campbell Barton
9ebc02fc99 Cleanup: spelling, repeated words (make check_spelling_*) 2025-09-26 22:00:27 +10:00
Campbell Barton
c5d7d58209 Cleanup: correct terminating macro
Harmless but the begin/end macros didn't match.
2025-09-26 21:58:34 +10:00
Campbell Barton
03d85d3779 Fix: logical errors where changes were always detected 2025-09-26 21:58:34 +10:00
Pablo Vazquez
916f0afd45 UI: Nodes: Add Node Group Indicator and minor style tweaks
Nodes have many indicators in their header: whether they have a
preview, warnings, whether they are a node group, plus potentially
more such as if the library is linked/overriden or packed data.

Of all indicators, whether the node is a node group or not is often not
so relevant (especially when many nodes will be just node group assets)
so having an icon takes away precious real estate for other indicators.

Draw the node shape slightly different. A subtle "stack" of nodes
behind Node Groups indicate this is more than just one node.
The stack is only drawn at a certain zoom.

It is now possible to double-click a node group to enter.

It also makes some more room for the node label, since the node group
icon in the header is no longer needed.

Plus a few visual tweaks and fixes for broken/non-valid nodes.

See PR for details and screenshots.

Pull Request: https://projects.blender.org/blender/blender/pulls/145674
2025-09-26 13:29:45 +02:00
Christoph Lendenfeld
b2653be057 Anim: Place Pose Bone Gizmo at Custom Transform
This PR adds an option "Affect Gizmo" for custom shape transforms to affect
the transform gizmos. If enabled, this will place the gizmo at the
location and orientation of the "Override Transform" (i.e. in its local space).

For Orientations: The gizmo mode *is* respected. I.e. global mode is aligned to the world etc.
There is a special case for "Gimbal" where it will not follow the orientation of the
"Override Transform" bone. I think it makes sense to keep it that way since this
is about the channels of the bone you are actually manipulating.

The other option is "Use as Pivot" with which the bone is actually rotated
around the override bone. This can be useful for rigs in which shapekeys and
armature deformation is combined

Taken over from #136468
For design task #135429

Co-authored-by: Wayde Moss <wbmoss_dev@yahoo.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/142847
2025-09-26 13:25:01 +02:00