Skip to content

Commit 8eb446f

Browse files
committed
Add ability to load from dictionary.
1 parent 8f22a2a commit 8eb446f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

NodeGraphQt/base/graph.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,17 @@ def serialize_session(self):
811811
"""
812812
return self._serialize(self.all_nodes())
813813

814+
def deserialize_session(self, layout_data):
815+
"""
816+
Load node graph session from a dictionary object.
817+
818+
Args:
819+
layout_data (dict): dictionary object containing a node session.
820+
"""
821+
self.clear_session()
822+
self._deserialize(layout_data)
823+
self._undo_stack.clear()
824+
814825
def save_session(self, file_path):
815826
"""
816827
Saves the current node graph session layout to a `JSON` formatted file.

0 commit comments

Comments
 (0)