From 7c9decdded39e782cf62beca27204adf76eda41e Mon Sep 17 00:00:00 2001 From: Swann Martinez Date: Wed, 2 Oct 2019 16:19:44 +0200 Subject: [PATCH] fix: bl_ related errors --- multi_user/bl_types/bl_material.py | 8 ++++++-- multi_user/bl_types/bl_object.py | 4 ++-- multi_user/bl_types/bl_world.py | 7 +++++-- multi_user/operators.py | 6 +++--- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/multi_user/bl_types/bl_material.py b/multi_user/bl_types/bl_material.py index 2717089..5bf650c 100644 --- a/multi_user/bl_types/bl_material.py +++ b/multi_user/bl_types/bl_material.py @@ -1,10 +1,12 @@ import bpy import mathutils +import logging from jsondiff import diff from .. import utils from .bl_datablock import BlDatablock +logger = logging.getLogger(__name__) def load_node(target_node_tree, source): target_node = target_node_tree.nodes.get(source["name"]) @@ -22,8 +24,10 @@ def load_node(target_node_tree, source): for input in source["inputs"]: if hasattr(target_node.inputs[input], "default_value"): - target_node.inputs[input].default_value = source["inputs"][input]["default_value"] - + try: + target_node.inputs[input].default_value = source["inputs"][input]["default_value"] + except: + logger.error("{} not supported, skipping".format(input)) def load_link(target_node_tree, source): input_socket = target_node_tree.nodes[source['to_node'] diff --git a/multi_user/bl_types/bl_object.py b/multi_user/bl_types/bl_object.py index 99699c4..7e91c47 100644 --- a/multi_user/bl_types/bl_object.py +++ b/multi_user/bl_types/bl_object.py @@ -106,10 +106,10 @@ class BlObject(BlDatablock): def diff(self): diff_rev = diff(self.dump(pointer=self.pointer), self.buffer) return (self.bl_diff() or - len(diff_rev.keys())) + len(diff_rev.keys())>0) def resolve_dependencies(self): - deps = super().resolve_dependencies() + deps = [] # Avoid Empty case if self.pointer.data: diff --git a/multi_user/bl_types/bl_world.py b/multi_user/bl_types/bl_world.py index b939c44..68c3048 100644 --- a/multi_user/bl_types/bl_world.py +++ b/multi_user/bl_types/bl_world.py @@ -38,7 +38,9 @@ class BlWorld(BlDatablock): "uuid", "color", "cycles", - "light_settings" + "light_settings", + "users", + "view_center" ] data = world_dumper.dump(pointer) if pointer.use_nodes: @@ -60,7 +62,8 @@ class BlWorld(BlDatablock): "outputs", "preview", "original", - "width_hidden" + "width_hidden", + ] for node in pointer.node_tree.nodes: diff --git a/multi_user/operators.py b/multi_user/operators.py index e34dd58..2fe6fea 100644 --- a/multi_user/operators.py +++ b/multi_user/operators.py @@ -136,7 +136,7 @@ class SessionStartOperator(bpy.types.Operator): delayables.append(delayable.DynamicRightSelectTimer()) # Push all added values - client.push() + client.push_all() # Launch drawing module if settings.enable_presence: @@ -280,7 +280,7 @@ class SessionApply(bpy.types.Operator): def execute(self, context): global client - client.apply(uuid=self.target) + client.apply(self.target) return {"FINISHED"} @@ -301,7 +301,7 @@ class SessionCommit(bpy.types.Operator): global client client.commit(uuid=self.target) - client.push(uuid=self.target) + client.push(self.target) return {"FINISHED"}