From f09d465a6da896e7e75ab34fa4e959ec3e48d2b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20T=C3=B6nne?= Date: Mon, 12 Jun 2023 14:21:50 +0200 Subject: [PATCH] Fix #108376: Copy from geometry to other node tree types resets shapes Socket shapes are used in geometry nodes to indicate field types. In other tree types (e.g. shaders) the socket shape is not touched at all. Since nodes can be copied from geometry node trees, we need to reset the socket shape when copying to a shader, compositor, or texture tree. Pull Request: https://projects.blender.org/blender/blender/pulls/108412 --- source/blender/editors/space_node/clipboard.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/blender/editors/space_node/clipboard.cc b/source/blender/editors/space_node/clipboard.cc index 5ed91cd4fbe..b3cdfbc3871 100644 --- a/source/blender/editors/space_node/clipboard.cc +++ b/source/blender/editors/space_node/clipboard.cc @@ -245,6 +245,13 @@ static int node_clipboard_paste_exec(bContext *C, wmOperator *op) { bNode *new_node = bke::node_copy_with_mapping( &tree, node, LIB_ID_COPY_DEFAULT, true, socket_map); + /* Reset socket shape in case a node is copied to a different tree type. */ + LISTBASE_FOREACH (bNodeSocket *, socket, &new_node->inputs) { + socket->display_shape = SOCK_DISPLAY_SHAPE_CIRCLE; + } + LISTBASE_FOREACH (bNodeSocket *, socket, &new_node->outputs) { + socket->display_shape = SOCK_DISPLAY_SHAPE_CIRCLE; + } node_map.add_new(&node, new_node); } else {