diff --git a/multi_user/__init__.py b/multi_user/__init__.py index 603139c..a3749ce 100644 --- a/multi_user/__init__.py +++ b/multi_user/__init__.py @@ -47,7 +47,8 @@ from . import environment, utils DEPENDENCIES = { ("zmq","zmq"), ("jsondiff","jsondiff"), - ("deepdiff", "deepdiff") + ("deepdiff", "deepdiff"), + ("psutil","psutil") } diff --git a/multi_user/libs/replication b/multi_user/libs/replication index 5e0b076..3400d7c 160000 --- a/multi_user/libs/replication +++ b/multi_user/libs/replication @@ -1 +1 @@ -Subproject commit 5e0b0766d7a6724f7b7beeeb62696d6d2d5193a6 +Subproject commit 3400d7c293ba181139931d0dd9a797fe804df2e8 diff --git a/multi_user/operators.py b/multi_user/operators.py index b70ad92..1581508 100644 --- a/multi_user/operators.py +++ b/multi_user/operators.py @@ -198,7 +198,7 @@ class SessionInitOperator(bpy.types.Operator): @classmethod def poll(cls, context): return True - + def draw(self, context): layout = self.layout col = layout.column() @@ -210,18 +210,18 @@ class SessionInitOperator(bpy.types.Operator): def execute(self, context): global client - + if self.init_method == 'EMPTY': utils.clean_scene() for scene in bpy.data.scenes: client.add(scene) - + client.init() - return {"FINISHED"} + class SessionStopOperator(bpy.types.Operator): bl_idname = "session.stop" bl_label = "close" @@ -234,12 +234,15 @@ class SessionStopOperator(bpy.types.Operator): def execute(self, context): global client, delayables, stop_modal_executor - assert(client) - try: - client.disconnect() - except Exception as e: - self.report({'ERROR'}, repr(e)) + if client: + try: + client.disconnect() + except Exception as e: + self.report({'ERROR'}, repr(e)) + else: + self.report({'WARNING'}, "No session to quit.") + return {"FINISHED"} return {"FINISHED"} @@ -558,6 +561,7 @@ classes = ( ) + @persistent def sanitize_deps_graph(dummy): """sanitize deps graph @@ -594,7 +598,6 @@ def register(): for cls in classes: register_class(cls) - bpy.app.handlers.undo_post.append(sanitize_deps_graph) bpy.app.handlers.redo_post.append(sanitize_deps_graph) @@ -602,7 +605,6 @@ def register(): bpy.app.handlers.frame_change_pre.append(update_client_frame) - def unregister(): global client @@ -617,7 +619,6 @@ def unregister(): bpy.app.handlers.undo_post.remove(sanitize_deps_graph) bpy.app.handlers.redo_post.remove(sanitize_deps_graph) - bpy.app.handlers.load_pre.remove(load_pre_handler) bpy.app.handlers.frame_change_pre.remove(update_client_frame)