Fix #138084: closure and bundles show up in UI even if disabled
This commit is contained in:
@@ -369,6 +369,12 @@ static bool is_socket_type_supported(blender::bke::bNodeTreeType *ntreetype,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!U.experimental.use_bundle_and_closure_nodes) {
|
||||
if (ELEM(socket_type->type, SOCK_BUNDLE, SOCK_CLOSURE)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -326,6 +326,11 @@ static void node_rna(StructRNA *srna)
|
||||
*r_free = true;
|
||||
return enum_items_filter(rna_enum_node_socket_data_type_items,
|
||||
[](const EnumPropertyItem &item) -> bool {
|
||||
if (!U.experimental.use_bundle_and_closure_nodes) {
|
||||
if (ELEM(item.value, SOCK_BUNDLE, SOCK_CLOSURE)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return ELEM(item.value,
|
||||
SOCK_FLOAT,
|
||||
SOCK_INT,
|
||||
|
||||
@@ -33,6 +33,11 @@ NODE_STORAGE_FUNCS(NodeMenuSwitch)
|
||||
|
||||
static bool is_supported_socket_type(const eNodeSocketDatatype data_type)
|
||||
{
|
||||
if (!U.experimental.use_bundle_and_closure_nodes) {
|
||||
if (ELEM(data_type, SOCK_BUNDLE, SOCK_CLOSURE)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return ELEM(data_type,
|
||||
SOCK_FLOAT,
|
||||
SOCK_INT,
|
||||
|
||||
@@ -225,6 +225,11 @@ static void node_rna(StructRNA *srna)
|
||||
*r_free = true;
|
||||
return enum_items_filter(rna_enum_node_socket_data_type_items,
|
||||
[](const EnumPropertyItem &item) -> bool {
|
||||
if (!U.experimental.use_bundle_and_closure_nodes) {
|
||||
if (ELEM(item.value, SOCK_BUNDLE, SOCK_CLOSURE)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return ELEM(item.value,
|
||||
SOCK_FLOAT,
|
||||
SOCK_INT,
|
||||
|
||||
Reference in New Issue
Block a user