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
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
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
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
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
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
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
"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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
The Parent Node Tree operator button to go up a level in nested
node trees is always visible in the header, regardless if we are
currently in a nested tree or not.
Only show the button when it is actually possible to go a level up.
This frees up space in the header when at the top level.