feat(rcf): scene init on server creation
This commit is contained in:
parent
b54e3aaf20
commit
c8bd0c7614
@ -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"}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user