Fix: Geometry Nodes: don't allow accessing anonymous attributes from named attribute nodes

This commit is contained in:
Jacques Lucke
2024-09-04 13:07:21 +02:00
parent d38b7286e9
commit 8fd1a6d094
2 changed files with 12 additions and 0 deletions

View File

@@ -90,6 +90,12 @@ static void node_geo_exec(GeoNodeExecParams params)
params.set_default_remaining_outputs();
return;
}
if (bke::attribute_name_is_anonymous(name)) {
params.error_message_add(NodeWarningType::Info,
TIP_("Anonymous attributes can't be accessed by name"));
params.set_default_remaining_outputs();
return;
}
params.used_named_attribute(name, NamedAttributeUsage::Read);

View File

@@ -94,6 +94,12 @@ static void node_geo_exec(GeoNodeExecParams params)
params.set_output("Geometry", std::move(geometry_set));
return;
}
if (bke::attribute_name_is_anonymous(name)) {
params.error_message_add(NodeWarningType::Info,
TIP_("Anonymous attributes can't be created here"));
params.set_output("Geometry", std::move(geometry_set));
return;
}
params.used_named_attribute(name, NamedAttributeUsage::Write);