Fix #129550: Node group default width not working for link-drag-search

When this feature was added we missed accounting for it in
all places where node groups were added.
This commit is contained in:
Hans Goudey
2024-10-30 17:40:39 +01:00
parent e163cc1fe0
commit a48f7f67f7

View File

@@ -204,13 +204,17 @@ static void search_link_ops_for_asset_metadata(const bNodeTree &node_tree,
Main &bmain = *CTX_data_main(&params.C);
bNode &node = params.add_node(params.node_tree.typeinfo->group_idname);
node.flag &= ~NODE_OPTIONS;
node.id = asset::asset_local_id_ensure_imported(bmain, asset);
bNodeTree *group = reinterpret_cast<bNodeTree *>(
asset::asset_local_id_ensure_imported(bmain, asset));
node.id = &group->id;
id_us_plus(node.id);
BKE_ntree_update_tag_node_property(&params.node_tree, &node);
DEG_relations_tag_update(&bmain);
node.flag &= ~NODE_OPTIONS;
node.width = group->default_group_node_width;
/* Create the inputs and outputs on the new node. */
nodes::update_node_declaration_and_sockets(params.node_tree, node);