fix library group io nodes not having reference to group node on load

This commit is contained in:
Lera Elvoé 2024-05-20 10:43:40 +03:00
parent 903a801ba9
commit 92ebbe5344
No known key found for this signature in database

View file

@ -694,24 +694,15 @@ static func from_dict(data: Dictionary, path: String = "") -> Deck:
if not node.is_library:
var group_data: Dictionary = groups_data[group_id]
group = DeckHolder.add_group_from_dict(group_data, group_id, group_instance_id, deck.id)
group.get_node(node.input_node_id).group_node = node
group.get_node(node.output_node_id).group_node = node
else:
group = DeckHolder.add_lib_instance(
node.group_id.get_file().trim_suffix(".deck"),
deck.id,
node.group_instance_id
)
for io_node_id: String in deck.nodes:
var io_node := deck.get_node(io_node_id)
if io_node.node_type == "group_input":
node.input_node_id = io_node._id
io_node.group_node = node
continue
if io_node.node_type == "group_output":
node.output_node_id = io_node._id
io_node.group_node = node
continue
group.get_node(node.input_node_id).group_node = node
group.get_node(node.output_node_id).group_node = node
node.init_io()
return deck