fix: bl_ related errors

This commit is contained in:
Swann Martinez 2019-10-02 16:19:44 +02:00
parent 98999f09bb
commit 7c9decdded
No known key found for this signature in database
GPG Key ID: 414CCAFD8DA720E1
4 changed files with 16 additions and 9 deletions

View File

@ -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']

View File

@ -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:

View File

@ -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:

View File

@ -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"}