feat: explicit state loading error
This commit is contained in:
parent
1f0f44fdbf
commit
c00b2a2d7d
@ -135,6 +135,10 @@ class BlObject(BlDatablock):
|
||||
data_uuid,
|
||||
find_data_from_name(data_id),
|
||||
ignore=['images']) # TODO: use resolve_from_id
|
||||
|
||||
if object_data is None and data_uuid:
|
||||
raise Exception(f"Fail to load object {data['name']}({self.uuid})")
|
||||
|
||||
instance = bpy.data.objects.new(object_name, object_data)
|
||||
instance.uuid = self.uuid
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user