feat: progression on session mamnagment
This commit is contained in:
@ -18,7 +18,7 @@ class BlUser(BlDatablock):
|
|||||||
|
|
||||||
def construct(self, data):
|
def construct(self, data):
|
||||||
user = bpy.data.window_managers['WinMan'].online_users.add()
|
user = bpy.data.window_managers['WinMan'].online_users.add()
|
||||||
user.name = self.uuid
|
user.name = data['name']
|
||||||
user.username = data['name']
|
user.username = data['name']
|
||||||
user.current_frame = data['current_frame']
|
user.current_frame = data['current_frame']
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ class BlUser(BlDatablock):
|
|||||||
self.pointer.is_dirty = True
|
self.pointer.is_dirty = True
|
||||||
|
|
||||||
def resolve(self):
|
def resolve(self):
|
||||||
self.pointer = bpy.data.window_managers['WinMan'].online_users.get(self.uuid)
|
self.pointer = bpy.data.window_managers['WinMan'].online_users.get(self.data['name'])
|
||||||
|
|
||||||
def is_valid(self):
|
def is_valid(self):
|
||||||
return True
|
return True
|
||||||
|
@ -211,3 +211,21 @@ class ClientUpdate(Timer):
|
|||||||
|
|
||||||
if client:
|
if client:
|
||||||
client.pointer.update_location()
|
client.pointer.update_location()
|
||||||
|
|
||||||
|
# sync online users
|
||||||
|
session_users = operators.client.online_users
|
||||||
|
ui_users = bpy.context.window_manager.online_users
|
||||||
|
|
||||||
|
for index, user in enumerate(ui_users):
|
||||||
|
if user.username not in session_users.keys():
|
||||||
|
ui_users.remove(index)
|
||||||
|
bpy.context.window_manager.session.presence_show_user = False
|
||||||
|
bpy.context.window_manager.session.presence_show_user = True
|
||||||
|
presence.refresh_3d_view()
|
||||||
|
break
|
||||||
|
|
||||||
|
for user in session_users:
|
||||||
|
if user not in ui_users:
|
||||||
|
new_key = ui_users.add()
|
||||||
|
new_key.name = user
|
||||||
|
new_key.username = user
|
Submodule multi_user/libs/replication updated: 3b6bfce7fc...5dcd8e14d7
@ -56,11 +56,12 @@ class SessionStartOperator(bpy.types.Operator):
|
|||||||
# TODO: Sync server clients
|
# TODO: Sync server clients
|
||||||
|
|
||||||
users.clear()
|
users.clear()
|
||||||
#load our infos into the local user list
|
|
||||||
local_user = users.add()
|
# #load our infos into the local user list
|
||||||
local_user.name = 'localhost'
|
# local_user = users.add()
|
||||||
local_user.username = settings.username
|
# local_user.name = 'localhost'
|
||||||
local_user.current_frame = context.scene.frame_current
|
# local_user.username = settings.username
|
||||||
|
# local_user.current_frame = context.scene.frame_current
|
||||||
|
|
||||||
# save config
|
# save config
|
||||||
settings.save(context)
|
settings.save(context)
|
||||||
|
Reference in New Issue
Block a user