diff --git a/multi_user/bl_types/bl_action.py b/multi_user/bl_types/bl_action.py index 891b8b2..061ced7 100644 --- a/multi_user/bl_types/bl_action.py +++ b/multi_user/bl_types/bl_action.py @@ -219,7 +219,7 @@ def load_fcurve(fcurve_data, fcurve): def dump_animation_data(datablock): animation_data = {} if has_action(datablock): - animation_data['action'] = datablock.animation_data.action.name + animation_data['action'] = datablock.animation_data.action.uuid if has_driver(datablock): animation_data['drivers'] = [] for driver in datablock.animation_data.drivers: @@ -241,8 +241,10 @@ def load_animation_data(animation_data, datablock): for driver in animation_data['drivers']: load_driver(datablock, driver) - if 'action' in animation_data: - datablock.animation_data.action = bpy.data.actions[animation_data['action']] + action = animation_data.get('action') + if action: + action = resolve_datablock_from_uuid(action, bpy.data.actions) + datablock.animation_data.action = action elif datablock.animation_data.action: datablock.animation_data.action = None diff --git a/multi_user/bl_types/bl_material.py b/multi_user/bl_types/bl_material.py index 0b5878f..bac300d 100644 --- a/multi_user/bl_types/bl_material.py +++ b/multi_user/bl_types/bl_material.py @@ -411,8 +411,6 @@ class BlMaterial(ReplicatedDatablock): @staticmethod def load(data: dict, datablock: object): - load_animation_data(data.get('animation_data'), datablock) - loader = Loader() is_grease_pencil = data.get('is_grease_pencil') @@ -428,6 +426,7 @@ class BlMaterial(ReplicatedDatablock): if datablock.node_tree is None: datablock.use_nodes = True + load_animation_data(data.get('animation_data'), datablock.node_tree) load_node_tree(data['node_tree'], datablock.node_tree) @staticmethod @@ -497,7 +496,7 @@ class BlMaterial(ReplicatedDatablock): elif datablock.use_nodes: data['node_tree'] = dump_node_tree(datablock.node_tree) - data['animation_data'] = dump_animation_data(datablock) + data['animation_data'] = dump_animation_data(datablock.node_tree) return data @staticmethod @@ -512,7 +511,7 @@ class BlMaterial(ReplicatedDatablock): if datablock.use_nodes: deps.extend(get_node_tree_dependencies(datablock.node_tree)) - deps.extend(resolve_animation_dependencies(datablock)) + deps.extend(resolve_animation_dependencies(datablock.node_tree)) return deps