This ports the Warning node from Geometry Nodes and the Compositor to
shader nodes. It is entirely handled by the inliner, so underlying
render engines don't need to change.
The node allows creating custom error/warning/info messages for higher
level node groups.
The most tricky thing about this node is that the warning node is not
necessarily connected to the output. The same solution as for Geometry
Nodes is used:
* If the output of the warning node is connected, nothing special is done.
The node is just evaluated if its output is used.
* If the output is unconnected, the node is evaluated if evaluation
enters the compute context of that node.
We call nodes which need to be evaluated even though they are not
connected to the final output "side effect nodes". I used the same
terminology here.
Pull Request: https://projects.blender.org/blender/blender/pulls/162756
This patch implements the new Layered Compositor in Blender. The layered
compositor essentially replaces the single scene compositing node tree
with a stack of effects each referencing a compositing node tree. The
output of each effect is supplied as the input of the following effect,
while the first effect gets the combined pass as an input. This is
essentially similar to Geometry Nodes modifiers and sequencer compositor
modifiers. Each effect can be enabled or disabled in render or preview
independently. A new asset trait for compositor node groups was added
for scene effects. Only the viewer in the active effect is considered
active, if not, the viewer will fallback to the output of the entire
effects stack.
A new properties tab for the compositor was added which for now only
contains the effects stack.
The implementation is mostly similar to Geometry Nodes modifiers for the
UI/Editor/Operations. Compositor-side, a new Scene Compositor Effect
operation was added that compiles the effects stack into an operator,
which is now used in both the render and viewport compositor
implementations.
Backward compatibility is maintained by adding a single compositor
effect containing the current compositing node group. Likewise, forward
compatibility is maintained by writing the first effect node group to
the legacy compositing node group. Python API compatibility is
maintained by setting/getting the node group of the first effect and
creating it if not already available.
Pull Request: https://projects.blender.org/blender/blender/pulls/160684
Instead of reusing `ERROR` for both warnings and errors, and the Info
Editor icon for "info" label comments, use the new icons from !161002.
* Use `STATUS_WARNING` when the code refers to simple warnings, the
feature might still work.
* Use `STATUS_ERROR` when the code refers to incompatibility, broken
functionality, general errors.
* Use `STATUS_INFO` for every info label. Keep `INFO` for the editor.
* Sometimes `WARNING_LARGE` was used, that should only be used for
dialogs. Use the regular warning instead, it looks almost the same.
* When extra contrast is needed, the filled version is used.
Mostly no big visual changes, other than warnings that were meant as
actual errors using the proper icon now.
See !161038 for details and screenshots.
Pull Request: https://projects.blender.org/blender/blender/pulls/161038
This patch adds support for frame animation playback caching in the
compositor. There is now a Frame Cache option in the side bar, when
enabled, the compositor will cache its final viewer result across
frames. The cache is drawn in the timeline editor with a new display
option for that cache. The cache is invalidated on any change that
affects the node tree. The cache respects the memory cache limit and
will evict cached frames in the limit was surpassed. This caching
mechanism only concerns the interactive compositor, not the viewport
compositor or the VSE compositors.
A few changes were made to support this patch:
- A new DEG_id_is_user_modified query function was added to detect if an
ID changed due to user input or not. This is used to do proper cached
invalidation. Thanks to Brecht for the implementation.
- The compositor job now internally suspends animation playback until
the compositor is done to make sure the entire frame range is computed
and cached. The previous behavior of frame dropping can still be
achieved using the playback frame dropping option.
Pull Request: https://projects.blender.org/blender/blender/pulls/159902
Moves Delete and Dissolve to the bottom above Online Manual to be in
line with 3D Viewport menu.
Rename "Rename..." to "Rename Active Node..." and move it higher.
See !159594 for screenshots.
Pull Request: https://projects.blender.org/blender/blender/pulls/159594
Ref: blender/blender-assets#61
Transform 3D coordinates into screen space and vice versa.
The PR introduces 4 utility nodes:
- 3D to screen space
- Screen to 3D space
- Transform and project (used by 3D to screen space)
- Project with depth (used by Screen to 3D space)
Note: All nodes are hidden from the compositor asset shelf.
Pull Request: https://projects.blender.org/blender/blender/pulls/159065
This adds initial support for compositor modifier assets.
Right now, every compositor node tree that is marked as an asset will
show up in the strip modifier `Add` menu.
* Node trees can be marked as an asset by right-clicking the data-block
selector and selecting `Mark as Asset`.
* In the asset browser, assets can be moved into catalogs (requires
saving the file with the asset).
* Node group assets that are in catalogs will show up in a menu/submenu
in the modifier "Add" menu.
The existing compositor node group essentials are automatically showing
up in the "Add" menu. The ones that can be used as modifiers include:
* `Camera & Lens Effects`:
* `Chromatic Aberration`
* `Sensor Noise`
* `Vignette`
* `Creative`
* `Sepia`
* `Split Toning`
* `Tune Image`
* `Unsharp Mask`
Note: Existing compositing node assets need to be re-saved in the
current version of Blender to correctly be showing up in the "Add" menu.
Pull Request: https://projects.blender.org/blender/blender/pulls/157461
This commit fixes a issue where the two "Go to Parent Node Tree"
commands (context menu, and header) behaved differently while having
the same icon and same tooltip. Now they behave the same, taking the
user up one level in the node tree path.
Pull Request: https://projects.blender.org/blender/blender/pulls/158252
The select and deselect buttons only apply to faces
assigned to the active material slot. Text objects don't
have faces so this doesn't apply to them. Fix by hiding
these buttons from text objects.
Pull Request: https://projects.blender.org/blender/blender/pulls/157094
Visualize the render region in the backdrop compositor. The UI and
behavior is similar to what was implemented in the image editor already
The color of the render region was changed from `TH_WIRE_EDIT`, which is
specific to image editor to the `TEXT` which is common between the node
and image editor. Visually, nothing changes for the default theme.
Text info will be implemented in a separate PR: https://projects.blender.org/blender/blender/pulls/154273
Pull Request: https://projects.blender.org/blender/blender/pulls/154230
The node operator 'Cut' was assigned Ctrl+X as a default shortcut. After
some testing this proved to be problematic for the following use case:
- Copy nodes A and B
- Dissolve node C as a preparation for pasting A and B
- Paste
- => The dissolved node C is pasted instead of the expected A and B
nodes.
This PR removes the shortcut, but keeps the operator accessible by
adding a new 'Cut' entry in the node context menu.
Note: the shortcut is not removed for the industry compatible keymap
because there are no conflicts with the dissolve operator there.
Pull Request: https://projects.blender.org/blender/blender/pulls/154522
Implements compositor-based Effects in VSE (#150636). Compositor
effects can be of all currently existing effect kinds:
Two input effects (transitions):
- Similar built-in effects: Cross fade, Wipe.
- Created on two selected strips.
- When creating a node group for them, the group input has
"Input 1", "Input 2" and a float "Effect Fader" (0..1 over strip
range) inputs.
- Expected use case: transitions or fancy combination of two strips.
Single input effects:
- Similar built-in effects: Blur, Glow.
- Created on one selected strip.
- When creating a node group for them, the group input has "Input"
and a float "Effect Fader" (0..1 over strip range) inputs.
- Expected use case: post-processing of input in screen-space
(different from strip modifiers, which operate in local space
before strip transform is applied).
Zero-input effects:
- Similar built-in effects: Solid Color, Text.
- Created when no strips are selected.
- When creating a node group for them, the group input only has a
float "Effect Fader" (0..1 over strip range) input.
- Expected use case: gradients, procedural textures.
General notes:
Menu item to create a Compositor strip is in top level menu; next to
Adjustment strip. It is not under "effect" or "transition" since
compositor strip can be 1 or 0 inputs.
Properties inspector for compositor strips displays their inputs (as
for any other effect), and the compositor node tree selector.
Note that this PR does not change anything in how effect inputs are
selected within VSE - the new Compositor effect works just like any
other effect that already exists. You create a new strip with none,
one or two strips selected, and that are the inputs of the effect.
These can be swapped (for two input effects) or reassigned later with
the usual operators.
Implementation notes:
The actual compositor effect code is very small; most of the work
inside the PR was:
- Changes across VSE codebase to allow non-fixed amount of inputs.
Since Compositor strip type can have either 0, 1 or 2 inputs now.
- Various places related to depsgraph & co, where it was handling
strip Compositor Modifiers; very similar code has been added to
also handle Compositor Effects.
- Just like compositor modifier, the compositor effect right now
only works on the CPU. Getting both to use GPU is future task.
Pull Request: https://projects.blender.org/blender/blender/pulls/150694
Small tweaks and add missing settings to the Node panel.
* Add missing `Show Options` toggle.
* Add missing `Mute` toggle.
* Add placeholder text to name and label inputs.
* Move `Color`, presets, and specials menu below `Label`, align in a row.
* Make `Color` inactive, instead of disabled when `use_custom_color` is off,
so it can be interacted with even while off.
* Remove the node icon from text inputs.
See PR for screenshots.
Pull Request: https://projects.blender.org/blender/blender/pulls/148672
The operator was never supported in the new compositor (since 4.4).
There are plans to reintroduce the feature, so for now only the UI
toggle and shortcuts are removed to avoid breaking changes.
Pull Request: https://projects.blender.org/blender/blender/pulls/153760
Small tweaks to the "Warning Propagation" property in the sidebar:
* Rename `Warning Propagation` UI label to `Propagate`.
* Rename `All` to `All Messages`, so it's more descriptive.
* Sort menu items from more to less.
* Add tooltip descriptions.
See PR for details and screenshots.
Pull Request: https://projects.blender.org/blender/blender/pulls/153603
The compositor shows a wrong node tree that is different for what is
actually pinned. That's because the code gets the node tree from the
scene, while it should get it from the space in this case.
This only fixes the UI part of #152525.
Pull Request: https://projects.blender.org/blender/blender/pulls/152566
Remove Use Nodes in the Shader Editor for lights. Lights will always use
nodes, though the node tree can be empty.
Compatibility:
The default node tree has no effect on the behavior
of lights, so backward and forward compatibility is preserved with the
extra nodes.
- Python API: The following script behaves the same way in main and
in this PR:
```python
light_data = bpy.data.lights.new(name="light
data", type='POINT') # default node tree created here
light_data.use_nodes = True # Has no effect, prints DeprecationWarning
```
- Blend file: Default nodes are created when loading files with 'Use
Nodes' disabled. Light properties like Power and Exposure are not
affected by the default node tree, so the change is backward
compatibile. For forward compatibility `use_nodes = true` is set when
writing blend files.
Pull Request: https://projects.blender.org/blender/blender/pulls/147410
Reusing the same operator type for all node tools is stretching the
limits of Blender's operator design too much, especially as node tools
become more featured and less homogenous. This is especially bad for
modal node tools in the future, where customizing a modal keymap
wouldn't work without significantly increased complexity. Other things
that don't work in the current design is remembering properties from an
operator's last execution, and having proper poll functions.
This PR changes the system to register a separate operator for every
asset and local tool. A new string property on the node group controls
the operator idname. This is set by default when creating a new tool, but
should be customized when creating an asset for sharing across files.
The change is not fully backward compatible. For existing node tools
to work with 5.1, the files must be opened and saved in 5.1 as well.
If the tool's name is not unique, the automatically chosen operator
needs to be changed.
Invalid or duplicate operator names are reported in the interface
where custom idnames are configured. Though this is conceptually
a more global problem, asset creators building tools to share are
expected to choose a unique name, and local node group names
are unique within a specific file anyway.
When a property that affects the registered operator changes, or
assets are loaded, these node group operators are re-registered.
Pull Request: https://projects.blender.org/blender/blender/pulls/148763
Currently when clicking the button to copy the modifier node tree it
does not get copied but a new one gets created. This PR implements that
the button actually duplicates the node tree instead of creating a new
one.
See PR for a demo video.
Pull Request: https://projects.blender.org/blender/blender/pulls/149529
How to reproduce:
- Create a new empty node group in a node tree
- Create a new group socket by clicking on '+' in the Group Sockets menu
- Notice the following error:
Traceback (most recent call last):
File "scripts/startup/bl_ui/space_node.py", line 1032, in draw
if active_item.item_type == 'PANEL':
^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'item_type'
Pull Request: https://projects.blender.org/blender/blender/pulls/150658
Adds ID-type filtering options like `filter_object`, `filter_brush`,
etc. to the asset shelf registration properties. This allows efficiently
discarding many irrelevant assets from further processing.
When displaying the asset shelf, we would call into the Python defined
`asset_poll()` method for every asset. This has some cost, and with many
assets this would add up and make the asset shelf slow to redraw. In the
compositor, transforming nodes would redraw the entire editor, including
the asset shelf, so this slowdown would become very apparent (we could
avoid redrawing the asset shelf here, but better address the slowdown
itself).
By having some way to let the asset shelf specify the ID types to
display, we can discard many assets before even calling the asset-poll
method.
Pull Request: https://projects.blender.org/blender/blender/pulls/150090
The "New Compositor Sequencer Node Group" button is currently disabled
when the selected strip has no compositor modifier.
This PR adds a "New Compositor Sequencer Modifier" which is used when
the strip has no active compositor modifier. That aligns the UI behavior with
the behavior of assigning geometry nodes to a object that has no geometry
nodes modifier and adds some convenience.
Pull Request: https://projects.blender.org/blender/blender/pulls/149403
By default the enabled catalog tabs in the asset shelf (the visible
tabs) are saved per editor in the file. This makes sense when the assets
you deal with are quite specific to the file or project, like with poses
for example.
I'd expect that typical custom compositing assets aren't too file or
project specific, and you want to be able to access them from any
Blender session. In that case it gets annoying if you have to manage the
enabled catalog tabs for every file, even though they are usually the
same ones. Storing them in the Preferences avoids this.
Tradeoff is that in cases where assets are more project specific, the
catalogs are still shared between project files. I think in practice
that's not a big annoyance though. It's basically a "remember last"
system, so it's predictable and simple.
Also note that changes are only automatically saved with _Auto-Save
Preferences_ enabled.
Pull Request: https://projects.blender.org/blender/blender/pulls/149359
These essentials assets are meant to be exposed in the "Add" menu but
don't really fit into the asset shelf. They are just implemented as
assets because they can be created from other nodes, but still serve a
low level purpose. They cannot be represented visually well, so they
don't have an asset preview. For the same reason we don't have an asset
shelf for geometry nodes at all, and only display them in the menu.
Displaying them alongside other essentials assets that have a preview in
the asset shelf looked odd.
Pull Request: https://projects.blender.org/blender/blender/pulls/149355
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