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 bpy
import mathutils import mathutils
import logging
from jsondiff import diff from jsondiff import diff
from .. import utils from .. import utils
from .bl_datablock import BlDatablock from .bl_datablock import BlDatablock
logger = logging.getLogger(__name__)
def load_node(target_node_tree, source): def load_node(target_node_tree, source):
target_node = target_node_tree.nodes.get(source["name"]) 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"]: for input in source["inputs"]:
if hasattr(target_node.inputs[input], "default_value"): if hasattr(target_node.inputs[input], "default_value"):
try:
target_node.inputs[input].default_value = source["inputs"][input]["default_value"] 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): def load_link(target_node_tree, source):
input_socket = target_node_tree.nodes[source['to_node'] input_socket = target_node_tree.nodes[source['to_node']

View File

@ -106,10 +106,10 @@ class BlObject(BlDatablock):
def diff(self): def diff(self):
diff_rev = diff(self.dump(pointer=self.pointer), self.buffer) diff_rev = diff(self.dump(pointer=self.pointer), self.buffer)
return (self.bl_diff() or return (self.bl_diff() or
len(diff_rev.keys())) len(diff_rev.keys())>0)
def resolve_dependencies(self): def resolve_dependencies(self):
deps = super().resolve_dependencies() deps = []
# Avoid Empty case # Avoid Empty case
if self.pointer.data: if self.pointer.data:

View File

@ -38,7 +38,9 @@ class BlWorld(BlDatablock):
"uuid", "uuid",
"color", "color",
"cycles", "cycles",
"light_settings" "light_settings",
"users",
"view_center"
] ]
data = world_dumper.dump(pointer) data = world_dumper.dump(pointer)
if pointer.use_nodes: if pointer.use_nodes:
@ -60,7 +62,8 @@ class BlWorld(BlDatablock):
"outputs", "outputs",
"preview", "preview",
"original", "original",
"width_hidden" "width_hidden",
] ]
for node in pointer.node_tree.nodes: for node in pointer.node_tree.nodes:

View File

@ -136,7 +136,7 @@ class SessionStartOperator(bpy.types.Operator):
delayables.append(delayable.DynamicRightSelectTimer()) delayables.append(delayable.DynamicRightSelectTimer())
# Push all added values # Push all added values
client.push() client.push_all()
# Launch drawing module # Launch drawing module
if settings.enable_presence: if settings.enable_presence:
@ -280,7 +280,7 @@ class SessionApply(bpy.types.Operator):
def execute(self, context): def execute(self, context):
global client global client
client.apply(uuid=self.target) client.apply(self.target)
return {"FINISHED"} return {"FINISHED"}
@ -301,7 +301,7 @@ class SessionCommit(bpy.types.Operator):
global client global client
client.commit(uuid=self.target) client.commit(uuid=self.target)
client.push(uuid=self.target) client.push(self.target)
return {"FINISHED"} return {"FINISHED"}