[Bf-blender-cvs] [9ba1ff1c632] master: Fix T86373: crash picking colors in geometry nodesockets

Philipp Oeser noreply at git.blender.org
Mon Mar 8 13:49:30 CET 2021


Commit: 9ba1ff1c6322cbacaaf7fad057cc507673dcd92d
Author: Philipp Oeser
Date:   Mon Mar 8 13:38:42 2021 +0100
Branches: master
https://developer.blender.org/rB9ba1ff1c6322cbacaaf7fad057cc507673dcd92d

Fix T86373: crash picking colors in geometry nodesockets

Caused by {rB85421c4fab02}.

Above commit treated `SOCK_RGBA` and `SOCK_STRING` the same in
`std_node_socket_draw`.
That would turn a RGBA button into a text button (for attribute search),
leading to trouble.
Note these were just treated the same prior to above commit because both
were doing the layout split.

Now just give RGBA sockets their own case.

Maniphest Tasks: T86373

Differential Revision: https://developer.blender.org/D10646

===================================================================

M	source/blender/editors/space_node/drawnode.c

===================================================================

diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index 977c2053187..a9a7ef5a0a2 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -3385,7 +3385,12 @@ static void std_node_socket_draw(
         }
       }
       break;
-    case SOCK_RGBA:
+    case SOCK_RGBA: {
+      uiLayout *row = uiLayoutSplit(layout, 0.5f, false);
+      uiItemL(row, text, 0);
+      uiItemR(row, ptr, "default_value", DEFAULT_FLAGS, "", 0);
+      break;
+    }
     case SOCK_STRING: {
       uiLayout *row = uiLayoutSplit(layout, 0.5f, false);
       uiItemL(row, text, 0);



More information about the Bf-blender-cvs mailing list