Nodes: Add distance float socket type

This is necessary to make float sockets display a value with the unit
system. `PROP_DISTANCE` will be used quite a lot by the mesh primitives
geometry nodes patch.

Differential Revision: https://developer.blender.org/D10711
This commit is contained in:
Hans Goudey 2021-03-13 17:15:50 -05:00
parent dcfea4a1e5
commit 9f68f5c1e1
Notes: blender-bot 2023-02-14 12:01:57 +01:00
Referenced by issue #87151, EXCEPTION_ACCESS_VIOLATION on file opening
3 changed files with 7 additions and 0 deletions

View File

@ -1568,6 +1568,8 @@ const char *nodeStaticSocketType(int type, int subtype)
return "NodeSocketFloatAngle";
case PROP_TIME:
return "NodeSocketFloatTime";
case PROP_DISTANCE:
return "NodeSocketFloatDistance";
case PROP_NONE:
default:
return "NodeSocketFloat";
@ -1637,6 +1639,8 @@ const char *nodeStaticSocketInterfaceType(int type, int subtype)
return "NodeSocketInterfaceFloatAngle";
case PROP_TIME:
return "NodeSocketInterfaceFloatTime";
case PROP_DISTANCE:
return "NodeSocketInterfaceFloatDistance";
case PROP_NONE:
default:
return "NodeSocketInterfaceFloat";

View File

@ -10088,6 +10088,8 @@ static void rna_def_node_socket_standard_types(BlenderRNA *brna)
brna, "NodeSocketFloatAngle", "NodeSocketInterfaceFloatAngle", PROP_ANGLE);
rna_def_node_socket_float(
brna, "NodeSocketFloatTime", "NodeSocketInterfaceFloatTime", PROP_TIME);
rna_def_node_socket_float(
brna, "NodeSocketFloatDistance", "NodeSocketInterfaceFloatDistance", PROP_DISTANCE);
rna_def_node_socket_int(brna, "NodeSocketInt", "NodeSocketInterfaceInt", PROP_NONE);
rna_def_node_socket_int(

View File

@ -712,6 +712,7 @@ void register_standard_node_socket_types(void)
nodeRegisterSocketType(make_socket_type_float(PROP_FACTOR));
nodeRegisterSocketType(make_socket_type_float(PROP_ANGLE));
nodeRegisterSocketType(make_socket_type_float(PROP_TIME));
nodeRegisterSocketType(make_socket_type_float(PROP_DISTANCE));
nodeRegisterSocketType(make_socket_type_int(PROP_NONE));
nodeRegisterSocketType(make_socket_type_int(PROP_UNSIGNED));