feat(rcf): scene init on server creation

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

View File

@ -211,8 +211,14 @@ def refresh_window():
bpy.ops.wm.redraw_timer(type='DRAW_WIN_SWAP', iterations=1)
def init_scene(msg):
pass
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)
client.push_update(key, value_type, value)
def update_scene(msg):
@ -359,6 +365,8 @@ class session_create(bpy.types.Operator):
bpy.ops.session.join()
init_scene()
bpy.app.timers.register(observer)
return {"FINISHED"}