diff options
author | Jacques Lucke <jacques@blender.org> | 2022-05-24 12:55:31 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-05-24 12:55:44 +0300 |
commit | f29ff7fb7e19d8e8dd5dd01ac527f0675467fbf2 (patch) | |
tree | a939aaac1ecc12b1fc906601f09471ee08f83cef /source/blender/editors/space_node/node_geometry_attribute_search.cc | |
parent | d1340e1bb250f6ec4b9781f4b9c5f01a9e4da9e9 (diff) |
Fix T98152: Named Attribute node changes data type for non-existant attributes
Skip changing the data type in the node if it is not known.
Diffstat (limited to 'source/blender/editors/space_node/node_geometry_attribute_search.cc')
-rw-r--r-- | source/blender/editors/space_node/node_geometry_attribute_search.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/space_node/node_geometry_attribute_search.cc b/source/blender/editors/space_node/node_geometry_attribute_search.cc index fee64da0459..9c0172cfabf 100644 --- a/source/blender/editors/space_node/node_geometry_attribute_search.cc +++ b/source/blender/editors/space_node/node_geometry_attribute_search.cc @@ -183,9 +183,9 @@ static void attribute_search_exec_fn(bContext *C, void *data_v, void *item_v) BLI_assert(socket->type == SOCK_STRING); /* For the attribute input node, also adjust the type and links connected to the output. */ - if (node->type == GEO_NODE_INPUT_NAMED_ATTRIBUTE) { + if (node->type == GEO_NODE_INPUT_NAMED_ATTRIBUTE && item->data_type.has_value()) { NodeGeometryInputNamedAttribute &storage = *(NodeGeometryInputNamedAttribute *)node->storage; - const CustomDataType new_type = data_type_in_attribute_input_node(item->data_type); + const CustomDataType new_type = data_type_in_attribute_input_node(*item->data_type); if (new_type != storage.data_type) { storage.data_type = new_type; /* Make the output socket with the new type on the attribute input node active. */ |