Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/BKE_node_ui_storage.hh
| Show All 13 Lines | |||||
| * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
| */ | */ | ||||
| #pragma once | #pragma once | ||||
| #include "BLI_hash.hh" | #include "BLI_hash.hh" | ||||
| #include "BLI_map.hh" | #include "BLI_map.hh" | ||||
| #include "BLI_session_uuid.h" | #include "BLI_session_uuid.h" | ||||
| #include "BLI_set.hh" | |||||
| #include "DNA_ID.h" | #include "DNA_ID.h" | ||||
| #include "DNA_modifier_types.h" | #include "DNA_modifier_types.h" | ||||
| #include "DNA_session_uuid_types.h" | #include "DNA_session_uuid_types.h" | ||||
| struct ModifierData; | struct ModifierData; | ||||
| struct Object; | struct Object; | ||||
| struct bNode; | struct bNode; | ||||
| Show All 40 Lines | |||||
| struct NodeWarning { | struct NodeWarning { | ||||
| NodeWarningType type; | NodeWarningType type; | ||||
| std::string message; | std::string message; | ||||
| }; | }; | ||||
| struct NodeUIStorage { | struct NodeUIStorage { | ||||
| blender::Vector<NodeWarning> warnings; | blender::Vector<NodeWarning> warnings; | ||||
| blender::Set<std::string> attribute_name_hints; | |||||
| }; | }; | ||||
| struct NodeTreeUIStorage { | struct NodeTreeUIStorage { | ||||
| blender::Map<NodeTreeEvaluationContext, blender::Map<std::string, NodeUIStorage>> context_map; | blender::Map<NodeTreeEvaluationContext, blender::Map<std::string, NodeUIStorage>> context_map; | ||||
| }; | }; | ||||
| void BKE_nodetree_ui_storage_free_for_context(bNodeTree &ntree, | void BKE_nodetree_ui_storage_free_for_context(bNodeTree &ntree, | ||||
| const NodeTreeEvaluationContext &context); | const NodeTreeEvaluationContext &context); | ||||
| void BKE_nodetree_error_message_add(bNodeTree &ntree, | void BKE_nodetree_error_message_add(bNodeTree &ntree, | ||||
| const NodeTreeEvaluationContext &context, | const NodeTreeEvaluationContext &context, | ||||
| const bNode &node, | const bNode &node, | ||||
| const NodeWarningType type, | const NodeWarningType type, | ||||
| std::string message); | std::string message); | ||||
| void BKE_nodetree_attribute_hint_add(bNodeTree &ntree, | |||||
HooglyBoogly: Might it make sense to support adding multiple attributes at the same time? Since in practice… | |||||
JacquesLuckeAuthorUnsubmitted Done Inline ActionsHmm, could be useful, but I wouldn't want to do it right now. I think passing in the attribute names separate might be even more efficient than constructing a separate set. Also note that in the future we might pass more information than just the attribute name (domain, type, ...). JacquesLucke: Hmm, could be useful, but I wouldn't want to do it right now. I think passing in the attribute… | |||||
HooglyBooglyUnsubmitted Not Done Inline ActionsOkay, with this version and foreach_attribute there is no temporary set built anyway, so this makes sense! HooglyBoogly: Okay, with this version and `foreach_attribute` there is no temporary set built anyway, so this… | |||||
| const NodeTreeEvaluationContext &context, | |||||
| const bNode &node, | |||||
| const blender::StringRef attribute_name); | |||||
Might it make sense to support adding multiple attributes at the same time? Since in practice, this will just union one or two sets/maps with each other.
The argument would then be a reference to the map of attribute data (or a set at first, if we still want to just store the names as a first step).
Theoretically this could then avoid copying completely, for the attributes from the first component.