diff options
author | Jacques Lucke <jacques@blender.org> | 2021-02-24 17:59:44 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-02-24 18:00:33 +0300 |
commit | c0b2c75c441db711ea27f23b0539371eeb159649 (patch) | |
tree | cd3b4615652fcb25c0d67508d035a6ce8bfb4844 /source/blender/blenkernel | |
parent | 7972785d7b90771f50534fe3e1101d8adb615fa3 (diff) |
Geometry Nodes: store available attribute names in node ui storage
This information will be used by the attribute search in string sockets.
Ref T85657.
Differential Revision: https://developer.blender.org/D10462
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_node_ui_storage.hh | 7 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/node_ui_storage.cc | 9 |
2 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_node_ui_storage.hh b/source/blender/blenkernel/BKE_node_ui_storage.hh index 951c3bdc62d..231eb11d473 100644 --- a/source/blender/blenkernel/BKE_node_ui_storage.hh +++ b/source/blender/blenkernel/BKE_node_ui_storage.hh @@ -19,6 +19,7 @@ #include "BLI_hash.hh" #include "BLI_map.hh" #include "BLI_session_uuid.h" +#include "BLI_set.hh" #include "DNA_ID.h" #include "DNA_modifier_types.h" @@ -76,6 +77,7 @@ struct NodeWarning { struct NodeUIStorage { blender::Vector<NodeWarning> warnings; + blender::Set<std::string> attribute_name_hints; }; struct NodeTreeUIStorage { @@ -94,3 +96,8 @@ void BKE_nodetree_error_message_add(bNodeTree &ntree, const bNode &node, const NodeWarningType type, std::string message); + +void BKE_nodetree_attribute_hint_add(bNodeTree &ntree, + const NodeTreeEvaluationContext &context, + const bNode &node, + const blender::StringRef attribute_name); diff --git a/source/blender/blenkernel/intern/node_ui_storage.cc b/source/blender/blenkernel/intern/node_ui_storage.cc index e03617a6505..ea492c4d36a 100644 --- a/source/blender/blenkernel/intern/node_ui_storage.cc +++ b/source/blender/blenkernel/intern/node_ui_storage.cc @@ -136,3 +136,12 @@ void BKE_nodetree_error_message_add(bNodeTree &ntree, NodeUIStorage &node_ui_storage = find_node_ui_storage(ntree, context, node); node_ui_storage.warnings.append({type, std::move(message)}); } + +void BKE_nodetree_attribute_hint_add(bNodeTree &ntree, + const NodeTreeEvaluationContext &context, + const bNode &node, + const StringRef attribute_name) +{ + NodeUIStorage &node_ui_storage = find_node_ui_storage(ntree, context, node); + node_ui_storage.attribute_name_hints.add_as(attribute_name); +} |