diff --git a/multi_user/bl_types/__init__.py b/multi_user/bl_types/__init__.py index 66c7c4a..2dc2d9c 100644 --- a/multi_user/bl_types/__init__.py +++ b/multi_user/bl_types/__init__.py @@ -41,7 +41,7 @@ __all__ = [ 'bl_node_group', 'bl_texture', "bl_particle", - 'bl_compositor' + # 'bl_compositor', ] # Order here defines execution order if bpy.app.version[1] >= 91: diff --git a/multi_user/bl_types/bl_scene.py b/multi_user/bl_types/bl_scene.py index fdbd542..8814872 100644 --- a/multi_user/bl_types/bl_scene.py +++ b/multi_user/bl_types/bl_scene.py @@ -448,6 +448,13 @@ class BlScene(ReplicatedDatablock): # FIXME: Find a better way after the replication big refacotoring # Keep other user from deleting collection object by flushing their history + + # Compositor + if data["use_nodes"]: + if datablock.node_tree is None: + datablock.use_nodes = True + + load_node_tree(data['node_tree'], datablock.node_tree) flush_history() @@ -519,6 +526,11 @@ class BlScene(ReplicatedDatablock): for seq in vse.sequences_all: dumped_sequences[seq.name] = dump_sequence(seq) data['sequences'] = dumped_sequences + + # Compositor + if datablock.use_nodes: + data['node_tree'] = dump_node_tree(datablock.node_tree) + data['animation_data'] = dump_animation_data(datablock) return data @@ -553,6 +565,12 @@ class BlScene(ReplicatedDatablock): Path(bpy.path.abspath(sequence.directory), elem.filename)) + # Compositor + if datablock.use_nodes: + deps.extend(get_node_tree_dependencies(datablock.node_tree)) + + deps.extend(resolve_animation_dependencies(datablock)) + return deps @staticmethod diff --git a/multi_user/bl_types/node_tree.py b/multi_user/bl_types/node_tree.py index c3d34ff..885bb5a 100644 --- a/multi_user/bl_types/node_tree.py +++ b/multi_user/bl_types/node_tree.py @@ -132,6 +132,7 @@ def dump_node(node: bpy.types.Node) -> dict: dump_io_needed = (node.type not in ['REROUTE', 'OUTPUT_MATERIAL']) + if dump_io_needed: io_dumper = Dumper() io_dumper.depth = 2 @@ -341,7 +342,7 @@ def load_node_tree(node_tree_data: dict, target_node_tree: bpy.types.NodeTree) - def get_node_tree_dependencies(node_tree: bpy.types.NodeTree) -> list: def has_image(node): return ( - node.type in ['TEX_IMAGE', 'TEX_ENVIRONMENT'] and node.image) + node.type in ['TEX_IMAGE', 'TEX_ENVIRONMENT','IMAGE','R_LAYER'] and node.image) def has_node_group(node): return ( hasattr(node, 'node_tree') and node.node_tree)