Skip to content

Commit 495ef82

Browse files
authored
Merge pull request #358 from jchanvfx/save_session_set_support
session serialize fix
2 parents adfb7ef + 8fdca97 commit 495ef82

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

NodeGraphQt/base/graph.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1862,12 +1862,19 @@ def save_session(self, file_path):
18621862
"""
18631863
serialized_data = self._serialize(self.all_nodes())
18641864
file_path = file_path.strip()
1865+
1866+
def default(obj):
1867+
if isinstance(obj, set):
1868+
return list(obj)
1869+
return obj
1870+
18651871
with open(file_path, 'w') as file_out:
18661872
json.dump(
18671873
serialized_data,
18681874
file_out,
18691875
indent=2,
1870-
separators=(',', ':')
1876+
separators=(',', ':'),
1877+
default=default
18711878
)
18721879

18731880
def load_session(self, file_path):

0 commit comments

Comments
 (0)