155 Commits

Author SHA1 Message Date
Jacques Lucke
1a5daab0d3 Merge branch 'blender-v5.0-release' 2025-10-16 18:37:47 +02:00
quackarooni
ce88d773db Fix: Nodes: bad ui for adding panel toggles
Adding panel toggles in nodegroups have somewhat of a UX antipattern. When
running the operator, it checks for conditions that indicate it should not run,
and if those are hit, it cancels execution and mentions the invalid condition in
the footer bar.

This is not ideal, the user should not have to call the operator to find out
whether it can be called.

Why it got implemented like this is likely a consequence of all interface items
being the same "New Item" operator. Poll functions cannot use operator
properties, so variants of the same operator cannot check for different
conditions for execution.

This is a problem for panel toggles, as they have more restrictions to when they
can be added that don't apply to other interface items.

This patch creates a separate operator for adding panel toggles. This allows the
condition checks to be implemented in the poll function, which enables greying
out the operator buttons and showing on tooltips what condition is invalid.

Pull Request: https://projects.blender.org/blender/blender/pulls/146379
2025-10-16 18:37:22 +02:00
Campbell Barton
7a249222be Cleanup: tweak multi-line parenthesis for Python scripts
Reduce right shift, moving closing parenthesis onto own line
for clarity & reducing diff noise in some cases.

Ref !147857
2025-10-12 03:31:31 +00:00
Pablo Vazquez
6a109a75dd Fix: Compositor: Add Asset Shelf toggle to View menu
Add missing Asset Shelf entry in the View menu in the Compositor.

Pull Request: https://projects.blender.org/blender/blender/pulls/147615
2025-10-08 14:57:53 +02:00
Pratik Borhade
3432c0b238 Fix #147431: Node Editor: 'Join in Named Frame' missing from menus
Operator isn't exposed in UI, now added inside Node menu.
Missed in 8ec093a2d8

Pull Request: https://projects.blender.org/blender/blender/pulls/147499
2025-10-08 11:10:36 +02:00
Habib Gahbiche
4c0408bbe6 Compositor: Make asset shelf visible by default
Now that we have assets bundled with Blender, the asset shelf can be
visible by default.

See also: #138983

Pull Request: https://projects.blender.org/blender/blender/pulls/147453
2025-10-06 16:00:00 +02:00
Jacques Lucke
b14b5a1aa0 Refactor: Nodes: move node tree interface panel to C++
The main goal is to simplify reusing this drawing code when drawing properties
for group input/output nodes. This is not implemented as part of this patch
though. The UI shouldn't change, except that the old code had an incomplete
`field_socket_types` list.

Pull Request: https://projects.blender.org/blender/blender/pulls/147231
2025-10-02 21:04:39 +02:00
Jacques Lucke
1e8636962e Refactor: Nodes: join group sockets with panel toggle panels
This simplifies the code a lot and is also a step towards making this code more reusable.

Pull Request: https://projects.blender.org/blender/blender/pulls/147041
2025-09-30 14:39:18 +02:00
Habib Gahbiche
4f722eaae3 Compositor: "Copy" button duplicates node tree
Currently, the compositor template ID creates a new node tree. This is
inconsistent with other node editors where the button copies the node
tree.
Also use "New" in geometry nodes operator description instead of "Copy"

Pull Request: https://projects.blender.org/blender/blender/pulls/146222
2025-09-30 11:46:32 +02:00
quackarooni
99b47b72aa Nodes: Remove "Swap" menu from editor header
Relocated the "Swap" menu from the header to inside of "Node" menu.
As it wasn't deemed ideal to put such a menu at the root level of the header.

Pull Request: https://projects.blender.org/blender/blender/pulls/146964
2025-09-29 17:22:15 +02:00
Jacques Lucke
f025637e3b Nodes: new operator to join Group Input nodes
This adds a new operator which can join multiple nodes together. Currently, it
only supports joining Group Input nodes. However, in the future it could be
extended to join e.g. Bake and Capture Attribute nodes.

This uses the recently freed up ctrl+J shortcut for this functionality, which
feels natural to me.

The implementation is fairly straight forward. The main tricky aspect is
sometimes the nodes can't be joined when that would result in two sockets being
linked to each other twice. In this case, the a separate Group Input node is
kept.

The selected nodes are merged into the active node (in case the active node is
part of the selection, otherwise there is a fallback).

Pull Request: https://projects.blender.org/blender/blender/pulls/146894
2025-09-29 13:58:27 +02:00
Omar Emara
73fcbaf7c4 VSE: Add Compositor modifier
This patch adds a new Compositor modifier that applies a compositing
node group on a sequencer strip. This patch also introduces the concept
of a compositor node tree space subtype, where we now have a Scene and a
Sequencer subtypes. Practically, this just means that node like the
Render Layers node will not be available in the node editor in the
Sequencer subtype.

Future improvements includes:

- The compositor context is recreated on every modifier application,
  while it should ideally be persistent somehow to make use of the
  compositor static cache. This might require work from the compositor
  side by moving the static cache outside of the context and make it
  thread safe if needed. See `Render.compositor` for an example on
  persistent context.
- GPU execution is not supported. This just needs a GPU context to be
  bound before execution, but the tricky part is getting a GPU context.
  See `render::Compositor::execute` for an example on bounding a GPU
  context and why it is less straight forward.
- Node inputs are not exposed on the sequencer modifier interface. An
  approach similar to Geometry Nodes modifier could be used, look at
  `update_input_properties_from_node_tree` for reference, but notice
  that Geometry Nodes naturally exempt the main Geometry socket because
  Geometry inputs can't be exposed, but for the compositor, we will have
  to exempt the main Color and Mask sockets manually. !145971

Co-authored-by: Aras Pranckevicius <aras@nesnausk.org>
Co-authored-by: Falk David <falk@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/139634
2025-09-26 08:40:42 +02:00
Campbell Barton
b4fbc0c32d Cleanup: remove f-strings use, use double quotes, quiet pylint warnings 2025-09-26 14:31:05 +10:00
quackarooni
2a1a658492 Nodes: Swap Node Operator
Implement a native method to swap between different node and zone types.

This implementation repurposes the existing menu definitions as base
classes, from which both an "Add" and a "Swap" version would be generated
from. This allows both menus to have the same layout, but use their own
operators for handling the different node/zone types.

In this PR, support for all node editors has been implemented.

Invoking the menu is currently bound to `Shift + S`, same as the old
implementation in Node Wrangler. Since "Swap" is implemented as a
regular menu, features that menus already have such as type-to-search
and adding to Quick Favorites don't require any extra caveats to
consider.

Resolves #133452

Pull Request: https://projects.blender.org/blender/blender/pulls/143997
2025-09-25 16:12:02 +02:00
Hans Goudey
fc4fc2d16c Geometry Nodes: Make displaying "Manage" panel optional
Often displaying the "Manage" panel is not very useful, or at least it
isn't worth taking up the screen real-estate. This commit adds an option
for showing the panel in the modifier, and adds an option to the node
group which is used to initialize the modifier option when creating a
modifier for a node group asset.

Pull Request: https://projects.blender.org/blender/blender/pulls/146775
2025-09-25 16:00:07 +02:00
Habib Gahbiche
1b4daf9d2e Nodes: remove "Use Nodes" in Shader Editor for Object Materials
"Use Nodes" was removed in the compositor to simplify the compositing
workflow. This introduced a slight inconsistency with the Shader Node
Editor.

This PR removes "Use Nodes" for object materials.

For Line Style, no changes are planned (not sure how to preserve
compatibility yet).
This simplifies the state of objects; either they have a material or
they don't.

Backward compatibility:
- If Use Nodes is turned Off, new nodes are added to the node tree to
simulate the same material:
- DNA: Only `use_nodes` is marked deprecated
- Python API:
  - `material.use_nodes` is marked deprecated and will be removed in
6.0. Reading it always returns `True` and setting it has no effect.
  - `material.diffuse_color`, `material.specular` etc.. Are not used by
EEVEE anymore but are kept because they are used by Workbench.

Forward compatibility:
Always enable 'Use Nodes' when writing blend files.

Known Issues:
Some UI tests are failing on macOS

Pull Request: https://projects.blender.org/blender/blender/pulls/141278
2025-09-14 17:53:54 +02:00
Campbell Barton
6a562caaae Cleanup: group package imports
Resolve warning from ruff.
2025-09-03 17:52:22 +10:00
Bastien Montagne
329112c4d3 NodeTree: Add 'real' custom properties to Nodes.
Add back custom properties to nodes, and properly expose them in the UI
as such (new 'Custom Properties' panel for nodes in the the Node
Editor).

This shows like any other custom property panel in the UI, in the Node editor:

<img width="424" alt="image.png" src="attachments/adb50815-0db0-447f-ac3b-7860d9a3e3fc">

Although not initially intended for this, nodes 'mixed' IDProperties
were quite widely used by py/extensions developers to store per-node
data.

During the initial IDProperties split between User-defined (aka custom
data) and system-defined (runtime RNA properties), this was not known,
so decision was made to only keep system properties for Nodes. The fact
that these properties were not exposed at all in UI also played a role
in that decision. See also discussions in #141042.

This commit instead splits system properties out into their own new
storage, and keep existing ones for user-defined/custom properties
(as done for other IDProperty owners, like IDs, bones, etc.).

Pull Request: https://projects.blender.org/blender/blender/pulls/145424
2025-09-02 14:13:28 +02:00
Omar Emara
3d7c8d022e Refactor: Nodes: Generalize node tree subtypes
This patch generalizes node tree subtypes to be usable for node trees
other than Geometry Nodes. In particular, this:

- Renames SpaceNode.geometry_nodes_type to node_tree_sub_type, which now
  store a tree type-specific enum.
- Renames SpaceNode.geometry_nodes_tool_tree to selected_node_group,
  which now stores any context-less tree of any type.

This breaks the python API due to renaming.

Pull Request: https://projects.blender.org/blender/blender/pulls/144544
2025-08-21 09:04:13 +02:00
Maxime-Cots
7a01f736a5 Nodes: Make context path breadcrumbs interactive
Make it possible to navigate in/out node groups through the breacrumbs
context path overlay.

See PR for details and screenshots.

Pull Request: https://projects.blender.org/blender/blender/pulls/141292
2025-08-20 17:53:34 +02:00
Habib Gahbiche
53380ed8b2 Cleanup: redundant check for shader type
Pull Request: https://projects.blender.org/blender/blender/pulls/143784
2025-08-01 13:38:54 +02:00
Habib Gahbiche
0a0dd4ca37 Compositor: add asset shelf
Add an asset shelf to the compositor node editor.

This is part of simplifying the compositing workflow:
https://projects.blender.org/blender/blender/issues/134214.

The reasoning is:
- Assets will help users get started more easily with compositing
- Assets will help keeping users within Blender and use the compositor
instead of doing post processing in a different software.
- The asset shelf is better than the asset browser because it has a
better user interface; it's easily hidable and doesn't take much space

The asset shelf is hidden by default in this PR, since we have no
assets yet.

Previously, a similar implementation was proposed for all node editors,
see https://projects.blender.org/blender/blender/pulls/110589.
We didn't move forward with this PR for the following reasons:
- For geometry nodes, no concrete use case was known/proposed
- The PR didn't intend to actually show the asset shelf, only
implement the possibility that it can be shown in node editors

Known Issues:
- Can't hide the asset shelf if region overlap is off: #129737

Pull Request: https://projects.blender.org/blender/blender/pulls/138983
2025-07-30 18:41:00 +02:00
Habib Gahbiche
445eceb02a Nodes: Remove "Use Nodes" in Shader Editor for World
Part of https://projects.blender.org/blender/blender/pulls/141278

Blend files compatibility:
If a World exists and "Use Nodes" is disabled, we add new nodes to the
existing node tree (or create one if it doesn't) that emulates the
behavior of a world without a node tree. This ensures backward and
forward compatibility.

Python API compatibility:
- `world.use_nodes` was removed from Python API => **Breaking change**
- `world.color` is still being used by Workbench, so it stays there,
although it has no effect anymore when using Cycles or EEVEE.

Python API changes:
Creating a World using `bpy.data.worlds.new()` now creates a World with
 an empty (embedded) node tree. This was necessary to enable Python
scripts to add nodes without having to create a node tree (which is
currently not possible, because World node trees are embedded).

Pull Request: https://projects.blender.org/blender/blender/pulls/142342
2025-07-28 14:06:08 +02:00
Habib Gahbiche
d88d4cc8ce Compositor: remove "Use Nodes"
Part of simplifying the compositor workflow:
https://projects.blender.org/blender/blender/issues/134214

The option "Use Nodes" is removed from the UI and marked deprecated.
It will get fully removed in 6.0.

"Use Nodes" is effectively replaced by the existing "Compositing"
option in the post-processing panel

Pull Request: https://projects.blender.org/blender/blender/pulls/138560
2025-06-18 18:39:02 +02:00
Nathan Vegdahl
86f2dd418d Merge branch 'blender-v4.5-release' 2025-06-16 17:40:46 +02:00
Nathan Vegdahl
941d2ac1e1 Anim: Add action + slot selector to node tree editor's side panel
Previously there was no way to select/manage the action and slot
assigned to most kinds of node trees. This addresses that oversight.

This applies to all node trees that are not embedded IDs.

Pull Request: https://projects.blender.org/blender/blender/pulls/140347
2025-06-16 17:39:28 +02:00
Clément Foucault
4fe75da973 EEVEE: Remove all remaining reference of EEVEE next
This changes the engine identifier back to `BLENDER_EEVEE`.

We keep the `BLENDER_EEVEE_NEXT` identifier around for
versioning reasons (have to detect when it is the active
engine of a older file).

This also rename a bunch of pannels that were using `next`
in their name.

This is a breaking change for Addons compatibility.

Pull Request: https://projects.blender.org/blender/blender/pulls/140282
2025-06-13 12:36:14 +02:00
Habib Gahbiche
bd61e69be5 Compositor: make compositor node trees reusable
This is part of the short term roadmap goal of simplifying the
compositor workflow
(see https://projects.blender.org/blender/blender/issues/134214).
The problem is that many users don't know how to get started with
compositing in Blender, even when they have used Blender for other
areas, e.g. modeling.

Note: although the solution makes compositor node trees reusable
accross blend files, this is a nice side effect and not the main goal
of the PR.

This PR implements a "New" button that creates a new compositing node
tree, and manages trees as IDs. This has following advantages:
- Consistent with other node editors and other parts of Blender,
therefore making it easier to getting started with compositing if users
are familiar with shading or geometry nodes
- Give users the ability to reuse the compositing node tree by linking
or appending it.

Note: The parameter "Use Nodes" is still present in this PR, but will
be removed (in a backward compatible way) in a follow up PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/135223
2025-06-10 17:46:55 +02:00
Habib Gahbiche
5b8f1fb0b9 Nodes: deactivate overlay buttons when no tree is assigned
Deactivate the following buttons when no node tree exists:
- Overlays (all node editors)
- Snap (all node editors)
- Gizmos (compositor only)
- Backdrop (compositor only)

Note: a node tree can exist although compositing is deactivated
(e.g. "Use Nodes" is set to False), in which case the buttons are
active.

Pull Request: https://projects.blender.org/blender/blender/pulls/139526
2025-06-02 19:28:18 +02:00
Habib Gahbiche
c956145530 Compositor: implement toggle for backdrop gizmos
The new gizmo toggle controls backdrop gizmo visibility for the
compositor node editor.

The implementation is consistent with the image editor, where the gizmo
toggle has a menu with a single entry, instead of having no drop down
menu at all.

The new toggle will be set inactive when there is no node tree in a
follow up PR: https://projects.blender.org/blender/blender/pulls/139526

Pull Request: https://projects.blender.org/blender/blender/pulls/139525
2025-06-02 17:48:19 +02:00
Pratik Borhade
0ad79ca541 Fix #139170: Regression: The Linked Node Group Socket Name is Editable
This probably have occured after migration from UIList. When nodetree ID
is linked form another file, disable the layout for individual rows and
the add/remove operator. Also tweak `supports_renaming()` function so that
individual tree element cannot be renamed when linked.

Pull Request: https://projects.blender.org/blender/blender/pulls/139269
2025-05-23 12:19:41 +02:00
Falk David
a7d2b7850e Grease Pencil: Add initial support for Node Tools
This adds inital Grease Pencil support for node tools.

Node tools work in `Object Mode`, `Edit Mode`,`Sculpt Mode`,
and `Draw Mode`.

While Grease Pencil has many editing tools, including editing
multiple frames at the same time, for now, node tools only
allow editing the current frame.

Currently, the idea is that node tools can do arbitrary changes
to the drawings, but cannot do changes to the existing layer tree, e.g.
changing the order of layers, removing a layer or groups, etc.

All the node tool specific nodes like `Selection` and `Set Selection`
are adapted to work with Grease Pencil. In `Draw Mode`, we currently
interpret everything as selected.
The `Active Element` node has a `Layer` mode that provides the
index of the active layer (if there is one).

When `Auto-Key` is used, a new keyframe is created on the
current frame.
Locked/invisible layers cannot be edited with node tools.

Pull Request: https://projects.blender.org/blender/blender/pulls/136624
2025-05-05 10:41:21 +02:00
Hans Goudey
937358d58e Point Cloud: Enable object type without experimental option
In the past couple months, the basic operations needed for a new object
type were implemented, as well as basic edit mode tools. With that, the
object type is in a good enough state that it doesn't need to be hidden
behind an experimental option. That also resolves some inconsistency,
because the object type is already created by geometry nodes and used by
importers; it's weird that you can't add it manually as original data.

This also removes the "bounds" drawing flag for the object created from
the add menu. It's unnecessary now and there was even a TODO comment.

Pull Request: https://projects.blender.org/blender/blender/pulls/137546
2025-04-15 20:08:46 +02:00
quackarooni
5a5ad978bf Nodes: Make spacing for Panel Toggle properties consistent with that of Boolean sockets
Panel toggles have a subpanel for listing out properties associated with their
Boolean checkbox.

The vertical spacing for properties in this panel is slightly different to how
normal Boolean sockets list their properties. This patch makes it more
consistent by putting the properties after `Default` in a `column` sublayout.

Pull Request: https://projects.blender.org/blender/blender/pulls/137211
2025-04-10 09:46:37 +02:00
quackarooni
a345f86e33 Fix #137169: "Panel Toggle" poll errors if a panel's first child item is a panel
The poll function for `NODE_PT_node_tree_interface_panel_toggle` looks at the
first child item and checks if it has the `is_panel_toggle` property set to
`True`. This fails if the first child is a panel, which doesn't have that
property.

The fix is to simply fall back to returning False if the first child item does
not have the aforementioned property.

Pull Request: https://projects.blender.org/blender/blender/pulls/137171
2025-04-09 10:17:41 +02:00
Omar Emara
7c0c31efb0 Nodes: Enable panel toggles in the Compositor
This patch enables panel toggles in the compositor since it now supports
boolean sockets. This essentially reverts c3957f432a.
2025-03-24 10:20:39 +02:00
Campbell Barton
4177b75e7a Cleanup: quiet warnings from ruff, use static sets 2025-03-04 16:02:55 +11:00
Jacques Lucke
c3957f432a Fix: Nodes: only expose panel toggles in geometry and shader nodes
The compositor does not support boolean sockets currently.
2025-02-28 19:23:44 +01:00
Falk David
2822777f13 Nodes: support boolean inputs as toggles in panel headers
Adds the option to create a boolean socket that can be used as a panel toggle.
This allows creating simpler and more compact node group UIs when a panel
can be "disabled".

The toggle input is a normal input socket that is just drawn a bit differently in
the UI. Whether a boolean is a toggle input or not does not affect evaluation.

Also see #133936 for guides on how to add and remove panel toggles.

Pull Request: https://projects.blender.org/blender/blender/pulls/133936
2025-02-28 19:07:02 +01:00
Dalai Felinto
e7214cbd31 Fix: missed point_cloud for node tools and more aggressive renaming
The issue was introduced on 1584cd9aa5 (see !134911 for details).

This fixes this and rename the remaining point_cloud from the API.
The DNA is left untouched, so users don't need to re-enable the
experimental point cloud feature.

Pull Request: https://projects.blender.org/blender/blender/pulls/134927
2025-02-24 14:43:08 +01:00
Campbell Barton
c7804568e7 Cleanup: reference imported types in class definitions 2025-02-13 10:15:19 +11:00
Campbell Barton
84c9e6e655 Cleanup: use single quotes for enums 2025-01-21 23:50:17 +11:00
Omar Emara
e52bbae2bf Compositor: Only show precision for GPU device
The compositor precision option only matters for GPU device, so hide it
when in CPU mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/132680
2025-01-08 07:41:48 +01:00
Campbell Barton
444f1064c9 Cleanup: remove unused functions, imports 2025-01-04 21:09:41 +11:00
Jacques Lucke
ebfbc7757b Fix #128589: allow disabling node group interface UI for custom node tree types
This adds a new `bl_use_group_interface` property that can be set on custom node
group types. By default it is `true` to avoid this being a breaking change. If
it's set to `false` some UI elements related to the built-in node group
interface are hidden.

Pull Request: https://projects.blender.org/blender/blender/pulls/131877
2024-12-14 11:51:19 +01:00
Aras Pranckevicius
82f0578ca3 Compositor: always use the new CPU compositor
Part of #125968: this makes the new CPU compositor always be used.

Pull Request: https://projects.blender.org/blender/blender/pulls/131783
2024-12-12 20:17:36 +01:00
Habib Gahbiche
35ea495bb6 UI: Nodes: Remove some snapping options
Compositor: UI: remove snapping to nodes.

Snapping nodes to other nodes behaves in a very unpredictable way, which makes most snapping options useless.

The patch removes the following:
- Snapping options `Node X`, `Node Y` and `Node XY`
- Menu `Snap Node Element`
- Menu `Snap Target`

New behavior:
- Activating `Snap` always acts as 'Snap to Grid'

Part of https://projects.blender.org/blender/blender/issues/128612

Pull Request: https://projects.blender.org/blender/blender/pulls/127667
2024-11-24 14:30:22 +01:00
Campbell Barton
8960285921 Cleanup: remove BLENDER_EEVEE from Blender's panels 2024-10-30 13:20:01 +11:00
Campbell Barton
f81dcbb67e Cleanup: remove BLENDER_EEVEE checks
Since the engine has been removed there is no need to check for it.
2024-10-30 13:20:00 +11:00
Campbell Barton
e10b0b3449 Cleanup: remove unused EEVEE panels
Besides being unused, some contained errors and would not have worked
if used.
2024-10-30 13:19:59 +11:00