Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharlie Jolly <charlie>2021-03-16 22:11:54 +0300
committerCharlie Jolly <mistajolly@gmail.com>2021-03-17 14:54:16 +0300
commit266cd7bb82ce4bfed20a3d61a84f25e2bacfca2b (patch)
tree963a983f902f5368669c1d93312b53262592e4dc /source/blender/nodes/intern
parent20bf736ff81c6fb79558796b74d50d4e7a9c8ef6 (diff)
Nodes: Add support to mute node wires
This patch adds the ability to mute individual wires in the node editor. This is invoked like the cut links operator but with a new shortcut. Mute = Ctrl + Alt Cut = Ctrl Dragging over wires will toggle the mute state for that wire. The muted wires are drawn in red with a bar across the center. Red is used in the nodes context to indicate invalid links, muted links and internal links. When a wire is muted it exposes the original node buttons which are normally hidden when a wire is connected. Downstream and upstream links connected using reroute nodes are also muted. Outside scope of patch: - Add support for pynodes e.g. Animation Nodes - Requires minor change to check for muted links using the `is_muted` link property or the `is_linked` socket property. Maniphest Tasks: T52659 Differential Revision: https://developer.blender.org/D2807
Diffstat (limited to 'source/blender/nodes/intern')
-rw-r--r--source/blender/nodes/intern/node_exec.c5
-rw-r--r--source/blender/nodes/intern/node_tree_ref.cc3
2 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/nodes/intern/node_exec.c b/source/blender/nodes/intern/node_exec.c
index 6207a1bf024..dd9d0b6796a 100644
--- a/source/blender/nodes/intern/node_exec.c
+++ b/source/blender/nodes/intern/node_exec.c
@@ -71,7 +71,8 @@ void node_get_stack(bNode *node, bNodeStack *stack, bNodeStack **in, bNodeStack
static void node_init_input_index(bNodeSocket *sock, int *index)
{
/* Only consider existing link if from socket is valid! */
- if (sock->link && sock->link->fromsock && sock->link->fromsock->stack_index >= 0) {
+ if (sock->link && !(sock->link->flag & NODE_LINK_MUTED) && sock->link->fromsock &&
+ sock->link->fromsock->stack_index >= 0) {
sock->stack_index = sock->link->fromsock->stack_index;
}
else {
@@ -131,7 +132,7 @@ static struct bNodeStack *setup_stack(bNodeStack *stack,
}
/* don't mess with remote socket stacks, these are initialized by other nodes! */
- if (sock->link) {
+ if (sock->link && !(sock->link->flag & NODE_LINK_MUTED)) {
return ns;
}
diff --git a/source/blender/nodes/intern/node_tree_ref.cc b/source/blender/nodes/intern/node_tree_ref.cc
index a66b7b1d2fe..8d979ffac9c 100644
--- a/source/blender/nodes/intern/node_tree_ref.cc
+++ b/source/blender/nodes/intern/node_tree_ref.cc
@@ -77,6 +77,9 @@ NodeTreeRef::NodeTreeRef(bNodeTree *btree) : btree_(btree)
}
LISTBASE_FOREACH (bNodeLink *, blink, &btree->links) {
+ if (blink->flag & NODE_LINK_MUTED) {
+ continue;
+ }
OutputSocketRef &from_socket = this->find_output_socket(
node_mapping, blink->fromnode, blink->fromsock);
InputSocketRef &to_socket = this->find_input_socket(