diff --git a/multi_user/__init__.py b/multi_user/__init__.py index 6d54b40..cd163d5 100644 --- a/multi_user/__init__.py +++ b/multi_user/__init__.py @@ -31,7 +31,7 @@ DEPENDENCIES = { logger = logging.getLogger(__name__) -logger.setLevel(logging.ERROR) +logger.setLevel(logging.INFO) #TODO: refactor config # UTILITY FUNCTIONS diff --git a/multi_user/bl_types/bl_collection.py b/multi_user/bl_types/bl_collection.py index 3de8af0..fbf9383 100644 --- a/multi_user/bl_types/bl_collection.py +++ b/multi_user/bl_types/bl_collection.py @@ -33,9 +33,8 @@ class BlCollection(BlDatablock): for collection in target.children: if collection.uuid not in data["children"]: - target.collection.children.unlink(collection) + target.children.unlink(collection) - utils.dump_anything.load(target, data) def dump(self, pointer=None): assert(pointer) @@ -45,6 +44,7 @@ class BlCollection(BlDatablock): # dump objects collection_objects = [] for object in pointer.objects: + if object not in collection_objects: collection_objects.append(object.uuid) data['objects'] = collection_objects @@ -52,6 +52,7 @@ class BlCollection(BlDatablock): # dump children collections collection_children = [] for child in pointer.children: + if child not in collection_children: collection_children.append(child.uuid) data['children'] = collection_children diff --git a/multi_user/bl_types/bl_user.py b/multi_user/bl_types/bl_user.py index 1f29deb..5092cf6 100644 --- a/multi_user/bl_types/bl_user.py +++ b/multi_user/bl_types/bl_user.py @@ -1,5 +1,6 @@ import bpy import mathutils +import jsondiff from .. import utils from .. import presence @@ -18,8 +19,8 @@ class BlUser(BlDatablock): def apply(self): # super().apply() - # self.data = jsondiff.patch(self.data, self.modifications, marshal=True) - # self.modifications = None + self.data = jsondiff.patch(self.data, self.modifications, marshal=True) + self.modifications = None if self.pointer: self.load(data=self.data, target=self.pointer) diff --git a/multi_user/environment.py b/multi_user/environment.py index 937c8c5..8b5b7ca 100644 --- a/multi_user/environment.py +++ b/multi_user/environment.py @@ -6,7 +6,7 @@ import sys from pathlib import Path logger = logging.getLogger(__name__) -logger.setLevel(logging.ERROR) +logger.setLevel(logging.INFO) CONFIG_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "config") CONFIG = os.path.join(CONFIG_DIR, "app.yaml") diff --git a/multi_user/libs/replication b/multi_user/libs/replication index 5f0beee..307de6f 160000 --- a/multi_user/libs/replication +++ b/multi_user/libs/replication @@ -1 +1 @@ -Subproject commit 5f0beee7b8123aad673326bed83d10106d5346b3 +Subproject commit 307de6fdcfd501a4004516fd6495eefb3fca9b0f diff --git a/multi_user/operators.py b/multi_user/operators.py index a238372..abb468e 100644 --- a/multi_user/operators.py +++ b/multi_user/operators.py @@ -22,7 +22,7 @@ from .libs.replication.replication.exception import NonAuthorizedOperationError from .libs.replication.replication.interface import Session logger = logging.getLogger(__name__) -logger.setLevel(logging.ERROR) +logger.setLevel(logging.INFO) client = None delayables = [] @@ -74,7 +74,7 @@ class SessionStartOperator(bpy.types.Operator): bpy_factory.register_type( _type.bl_class, _type.bl_rep_class, - timer=type_local_config.bl_delay_refresh, + timer=0,#type_local_config.bl_delay_refresh automatic=type_local_config.auto_push) if type_local_config.bl_delay_apply > 0: @@ -303,7 +303,7 @@ class SessionCommit(bpy.types.Operator): def execute(self, context): global client - + # client.get(uuid=target).diff() client.commit(uuid=self.target) client.push(self.target) return {"FINISHED"} diff --git a/multi_user/utils.py b/multi_user/utils.py index 8e5f051..2209a90 100644 --- a/multi_user/utils.py +++ b/multi_user/utils.py @@ -13,7 +13,7 @@ from . import environment, presence from .libs import dump_anything logger = logging.getLogger(__name__) -logger.setLevel(logging.ERROR) +logger.setLevel(logging.INFO) def find_from_attr(attr_name, attr_value, list):