Merge branch 'blender-v4.0-release'
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user