Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2022-05-31 14:20:16 +0300
committerHans Goudey <h.goudey@me.com>2022-05-31 14:20:16 +0300
commit4669178fc3786e1aebb117892d8dc6a2ce4dc955 (patch)
tree3680859a3b4337bd91669bd9a048afcbe46d6ba3 /source/blender/nodes
parent39c14f4e84c0813241659c9b56bef5a62d55e6c8 (diff)
Attributes: Hide internal UI attributes and disallow procedural access
This commit hides "UI attributes" described in T97452 from the UI lists in mesh, curve, and point cloud properties, and disallow accessing them in geometry nodes. Internal UI attributes like selection and hiding values should use the attribute system for simplicity and performance, but we don't want to expose those attributes in the attribute panel, which is meant for regular user interaction. Procedural access may be misleading or cause problems, as described in the design task above. These attributes are added by two upcoming patches: D14934, D14685 Differential Revision: https://developer.blender.org/D15069
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_input_named_attribute.cc5
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_remove_attribute.cc5
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_store_named_attribute.cc5
3 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_input_named_attribute.cc b/source/blender/nodes/geometry/nodes/node_geo_input_named_attribute.cc
index 72dfff7cb39..553ea6cfcf0 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_input_named_attribute.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_input_named_attribute.cc
@@ -82,6 +82,11 @@ static void node_geo_exec(GeoNodeExecParams params)
params.set_default_remaining_outputs();
return;
}
+ if (!bke::allow_procedural_attribute_access(name)) {
+ params.error_message_add(NodeWarningType::Info, TIP_(bke::no_procedural_access_message));
+ params.set_default_remaining_outputs();
+ return;
+ }
params.used_named_attribute(name, NamedAttributeUsage::Read);
diff --git a/source/blender/nodes/geometry/nodes/node_geo_remove_attribute.cc b/source/blender/nodes/geometry/nodes/node_geo_remove_attribute.cc
index effeac5a37f..ecda35f6363 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_remove_attribute.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_remove_attribute.cc
@@ -21,6 +21,11 @@ static void node_geo_exec(GeoNodeExecParams params)
params.set_output("Geometry", std::move(geometry_set));
return;
}
+ if (!bke::allow_procedural_attribute_access(name)) {
+ params.error_message_add(NodeWarningType::Info, TIP_(bke::no_procedural_access_message));
+ params.set_output("Geometry", std::move(geometry_set));
+ return;
+ }
std::atomic<bool> attribute_exists = false;
std::atomic<bool> cannot_delete = false;
diff --git a/source/blender/nodes/geometry/nodes/node_geo_store_named_attribute.cc b/source/blender/nodes/geometry/nodes/node_geo_store_named_attribute.cc
index 3b348dd0136..669740f27cb 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_store_named_attribute.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_store_named_attribute.cc
@@ -131,6 +131,11 @@ static void node_geo_exec(GeoNodeExecParams params)
params.set_output("Geometry", std::move(geometry_set));
return;
}
+ if (!bke::allow_procedural_attribute_access(name)) {
+ params.error_message_add(NodeWarningType::Info, TIP_(bke::no_procedural_access_message));
+ params.set_output("Geometry", std::move(geometry_set));
+ return;
+ }
params.used_named_attribute(name, NamedAttributeUsage::Write);