feat: explicit state loading error

This commit is contained in:
Swann
2021-02-09 14:20:08 +01:00
parent 1f0f44fdbf
commit c00b2a2d7d
2 changed files with 13 additions and 5 deletions

View File

@ -78,19 +78,23 @@ def initialize_session():
settings = utils.get_preferences()
runtime_settings = bpy.context.window_manager.session
logging.info("Constructing nodes")
# Step 1: Constrect nodes
logging.info("Constructing nodes")
for node in session._graph.list_ordered():
node_ref = session.get(uuid=node)
if node_ref.state == FETCHED:
if node_ref and node_ref.state == FETCHED:
node_ref.resolve()
logging.info("Loading nodes")
else:
logging.error(f"Can't construct node {node}")
# Step 2: Load nodes
logging.info("Loading nodes")
for node in session._graph.list_ordered():
node_ref = session.get(uuid=node)
if node_ref.state == FETCHED:
if node_ref and node_ref.state == FETCHED:
node_ref.apply()
else:
logging.error(f"Can't load node {node}")
logging.info("Registering timers")
# Step 4: Register blender timers