Skip to content

Commit 305b15a

Browse files
authored
Merge pull request #435 from jchanvfx/session_serial_fix_#434
addressing issue #434
2 parents 8f97f82 + e56c46b commit 305b15a

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

NodeGraphQt/base/graph.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1727,8 +1727,12 @@ def _serialize(self, nodes):
17271727
serial_data['graph']['pipe_style'] = self.pipe_style()
17281728

17291729
# connection constrains.
1730-
serial_data['graph']['accept_connection_types'] = self.model.accept_connection_types
1731-
serial_data['graph']['reject_connection_types'] = self.model.reject_connection_types
1730+
serial_data['graph']['accept_connection_types'] = {
1731+
k: list(v) for k, v in self.model.accept_connection_types.items()
1732+
}
1733+
serial_data['graph']['reject_connection_types'] = {
1734+
k: list(v) for k, v in self.model.reject_connection_types.items()
1735+
}
17321736

17331737
# serialize nodes.
17341738
for n in nodes:
@@ -1798,9 +1802,13 @@ def _deserialize(self, data, relative_pos=False, pos=None):
17981802

17991803
# connection constrains.
18001804
elif attr_name == 'accept_connection_types':
1801-
self.model.accept_connection_types = attr_value
1805+
self.model.accept_connection_types = {
1806+
k: set(v) for k, v in attr_value.items()
1807+
}
18021808
elif attr_name == 'reject_connection_types':
1803-
self.model.reject_connection_types = attr_value
1809+
self.model.reject_connection_types = {
1810+
k: set(v) for k, v in attr_value.items()
1811+
}
18041812

18051813
# build the nodes.
18061814
nodes = {}

NodeGraphQt/base/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def add_port_accept_connection_type(
245245
):
246246
"""
247247
Convenience function for adding to the "accept_connection_types" dict.
248-
If the node graph model is unavailable yet then we store it to a
248+
If the node graph model is unavailable, yet then we store it to a
249249
temp var that gets deleted.
250250
251251
Args:

0 commit comments

Comments
 (0)