feat(rcf.net_operators): Vector transmission is now working

This commit is contained in:
Swann
2019-02-14 10:30:33 +01:00
parent c3e935081e
commit 67c5976c74

View File

@ -19,12 +19,15 @@ def refresh_window(msg):
def patch_scene(msg):
path = msg.key.split('/')
value = None
object = getattr(bpy.data,path[0])[path[1]]
attribute = getattr(getattr(bpy.data,path[0])[path[1]],path[2])
print(type(attribute))
print("attribute: {}".format(attribute))
if type(attribute) == mathutils.Vector:
attribute = array2vector(msg.body)
#attribute = array2vector(msg.body)
value = array2vector(msg.body)
setattr(object,path[2],value)
def vector2array(v):
return [v.x,v.y,v.z]
@ -50,7 +53,7 @@ class session_join(bpy.types.Operator):
client = net_components.Client(id=username ,recv_callback=callbacks)
time.sleep(1)
bpy.ops.asyncio.loop()
return {"FINISHED"}