Cleanup: deduplicate field socket type check
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "BKE_node_runtime.hh"
|
||||
|
||||
#include "NOD_node_declaration.hh"
|
||||
#include "NOD_socket.hh"
|
||||
|
||||
#include "BLI_resource_scope.hh"
|
||||
#include "BLI_set.hh"
|
||||
@@ -20,14 +21,9 @@ using nodes::OutputFieldDependency;
|
||||
using nodes::OutputSocketFieldType;
|
||||
using nodes::SocketDeclaration;
|
||||
|
||||
static bool is_field_socket_type(eNodeSocketDatatype type)
|
||||
{
|
||||
return ELEM(type, SOCK_FLOAT, SOCK_INT, SOCK_BOOLEAN, SOCK_VECTOR, SOCK_RGBA, SOCK_ROTATION);
|
||||
}
|
||||
|
||||
static bool is_field_socket_type(const bNodeSocket &socket)
|
||||
{
|
||||
return is_field_socket_type((eNodeSocketDatatype)socket.typeinfo->type);
|
||||
return nodes::socket_type_supports_fields((eNodeSocketDatatype)socket.typeinfo->type);
|
||||
}
|
||||
|
||||
static InputSocketFieldType get_interface_input_field_type(const bNode &node,
|
||||
@@ -505,7 +501,7 @@ static void determine_group_input_states(
|
||||
const bNodeSocketType *typeinfo = group_input->socket_typeinfo();
|
||||
const eNodeSocketDatatype type = typeinfo ? eNodeSocketDatatype(typeinfo->type) :
|
||||
SOCK_CUSTOM;
|
||||
if (!is_field_socket_type(type)) {
|
||||
if (!nodes::socket_type_supports_fields(type)) {
|
||||
new_inferencing_interface.inputs[index] = InputSocketFieldType::None;
|
||||
}
|
||||
else if (group_input->default_input != NODE_INPUT_DEFAULT_VALUE) {
|
||||
|
||||
Reference in New Issue
Block a user