diff options
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r-- | source/blender/modifiers/intern/MOD_nodes.cc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc index fe5a8bc59d4..c7731815a2a 100644 --- a/source/blender/modifiers/intern/MOD_nodes.cc +++ b/source/blender/modifiers/intern/MOD_nodes.cc @@ -82,6 +82,7 @@ using blender::Map; using blender::Set; using blender::Span; using blender::StringRef; +using blender::StringRefNull; using blender::Vector; using blender::bke::PersistentCollectionHandle; using blender::bke::PersistentDataHandleMap; @@ -388,6 +389,8 @@ class GeometryNodesEvaluator { { const bNode &bnode = params.node(); + this->store_ui_hints(node, params); + /* Use the geometry-node-execute callback if it exists. */ if (bnode.typeinfo->geometry_node_execute != nullptr) { bnode.typeinfo->geometry_node_execute(params); @@ -405,6 +408,33 @@ class GeometryNodesEvaluator { this->execute_unknown_node(node, params); } + void store_ui_hints(const DNode &node, GeoNodeExecParams params) const + { + for (const DInputSocket *dsocket : node.inputs()) { + if (!dsocket->is_available()) { + continue; + } + if (dsocket->bsocket()->type != SOCK_GEOMETRY) { + continue; + } + + bNodeTree *btree_cow = node.node_ref().tree().btree(); + bNodeTree *btree_original = (bNodeTree *)DEG_get_original_id((ID *)btree_cow); + const NodeTreeEvaluationContext context(*self_object_, *modifier_); + + const GeometrySet &geometry_set = params.get_input<GeometrySet>(dsocket->identifier()); + const Vector<const GeometryComponent *> components = geometry_set.get_components_for_read(); + + for (const GeometryComponent *component : components) { + component->attribute_foreach([&](StringRefNull attribute_name, + const AttributeMetaData &UNUSED(meta_data)) { + BKE_nodetree_attribute_hint_add(*btree_original, context, *node.bnode(), attribute_name); + return true; + }); + } + } + } + void execute_multi_function_node(const DNode &node, GeoNodeExecParams params, const MultiFunction &fn) |