feat: mimic blender undo handling

This commit is contained in:
Swann
2020-10-15 17:21:14 +02:00
parent 9f8222afa7
commit f151c61d7b
2 changed files with 19 additions and 11 deletions

View File

@ -686,10 +686,14 @@ def sanitize_deps_graph(dummy):
A future solution should be to avoid storing dataclock reference...
"""
if session and session.state['STATE'] == STATE_ACTIVE:
for node_key in session.list():
session.get(node_key).resolve()
if session and session.state['STATE'] == STATE_ACTIVE:
session.lock()
for node_key in session.list():
node = session.get(node_key)
if node and not node.resolve(construct=False):
session.remove(node_key)
session.unlock()
@persistent
def load_pre_handler(dummy):