diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc index 1934d4b21d0..f8250f2651e 100644 --- a/source/blender/editors/space_node/node_draw.cc +++ b/source/blender/editors/space_node/node_draw.cc @@ -1205,7 +1205,13 @@ void node_socket_color_get(const bContext &C, float r_color[4]) { if (!sock.typeinfo->draw_color) { - copy_v4_v4(r_color, float4(1.0f, 0.0f, 1.0f, 1.0f)); + /* Fallback to the simple variant. If not defined either, fallback to a magenta color. */ + if (sock.typeinfo->draw_color_simple) { + sock.typeinfo->draw_color_simple(sock.typeinfo, r_color); + } + else { + copy_v4_v4(r_color, float4(1.0f, 0.0f, 1.0f, 1.0f)); + } return; } diff --git a/source/blender/makesrna/intern/rna_node_socket.cc b/source/blender/makesrna/intern/rna_node_socket.cc index fbc3dfc5c5d..a8a07e1e42d 100644 --- a/source/blender/makesrna/intern/rna_node_socket.cc +++ b/source/blender/makesrna/intern/rna_node_socket.cc @@ -592,7 +592,11 @@ static void rna_def_node_socket(BlenderRNA *brna) RNA_def_function_output(func, parm); func = RNA_def_function(srna, "draw_color_simple", nullptr); - RNA_def_function_ui_description(func, "Color of the socket icon"); + RNA_def_function_ui_description( + func, + "Color of the socket icon. Used to draw sockets in places where the socket does not belong " + "to a node, like the node interface panel. Also used to draw node sockets if draw_color is " + "not defined"); RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_REGISTER_OPTIONAL); parm = RNA_def_float_array( func, "color", 4, default_draw_color, 0.0f, 1.0f, "Color", "", 0.0f, 1.0f);