feat(rcf): append rotation support

This commit is contained in:
Swann Martinez 2019-03-14 11:25:46 +01:00
parent c8bd0c7614
commit 9856159e1c
No known key found for this signature in database
GPG Key ID: 414CCAFD8DA720E1

View File

@ -140,12 +140,12 @@ def from_bpy(value):
value_type = type(value)
value_casted = None
if value_type is mathutils.Vector:
if value_type is mathutils.Vector or value_type is mathutils.Euler:
value_casted = [value.x, value.y, value.z]
elif value_type is bpy.props.collection:
pass # TODO: Collection replication
elif value_type is mathutils.Euler:
value_casted = [value.x, value.y, value.z]
# elif value_type is mathutils.Euler:
# value_casted = [value.x, value.y, value.z]
elif value_type in NATIVE_TYPES:
value_casted = value
@ -160,10 +160,11 @@ def to_bpy(store_item):
value_casted = None
store_value = store_item.body
if value_type == 'Vector':
if value_type == 'Vector' or 'Euler':
value_casted = mathutils.Vector(
(store_value[0], store_value[1], store_value[2]))
return value_casted
@ -215,11 +216,14 @@ def init_scene():
global client
for object in bpy.context.scene.objects:
key = "objects/{}/location".format(object.name)
value_type, value = from_bpy(object.location)
for attr in dir(object):
try:
key = "objects/{}/{}".format(object.name,attr)
value_type, value = from_bpy(getattr(object,attr))
client.push_update(key, value_type, value)
except:
pass
def update_scene(msg):
global client