refactor: move update user metadata to porcelain

This commit is contained in:
Swann 2021-06-02 12:59:53 +02:00
parent 4c4cf8a970
commit 4c774d5d53
No known key found for this signature in database
GPG Key ID: E1D3641A7C43AACB
4 changed files with 7 additions and 7 deletions

View File

@ -19,7 +19,7 @@
bl_info = { bl_info = {
"name": "Multi-User", "name": "Multi-User",
"author": "Swann Martinez", "author": "Swann Martinez",
"version": (0, 4, 0), "version": (0, 5, 0),
"description": "Enable real-time collaborative workflow inside blender", "description": "Enable real-time collaborative workflow inside blender",
"blender": (2, 82, 0), "blender": (2, 82, 0),
"location": "3D View > Sidebar > Multi-User tab", "location": "3D View > Sidebar > Multi-User tab",

@ -1 +1 @@
Subproject commit b3123e51429c2db1fff710dd06aefdff4ee6abd1 Subproject commit c0db6246f3d49187cc4c673ffd48d692041b4828

View File

@ -937,7 +937,7 @@ def load_pre_handler(dummy):
@persistent @persistent
def update_client_frame(scene): def update_client_frame(scene):
if session and session.state == STATE_ACTIVE: if session and session.state == STATE_ACTIVE:
session.update_user_metadata({ porcelain.update_user_metadata(session.repository, {
'frame_current': scene.frame_current 'frame_current': scene.frame_current
}) })

View File

@ -230,7 +230,7 @@ class DynamicRightSelectTimer(Timer):
'selected_objects': current_selection 'selected_objects': current_selection
} }
session.update_user_metadata(user_metadata) porcelain.update_user_metadata(session.repository, user_metadata)
logging.debug("Update selection") logging.debug("Update selection")
# Fix deselection until right managment refactoring (with Roles concepts) # Fix deselection until right managment refactoring (with Roles concepts)
@ -305,18 +305,18 @@ class ClientUpdate(Timer):
'frame_current': bpy.context.scene.frame_current, 'frame_current': bpy.context.scene.frame_current,
'scene_current': scene_current 'scene_current': scene_current
} }
session.update_user_metadata(metadata) porcelain.update_user_metadata(session.repository, metadata)
# Update client representation # Update client representation
# Update client current scene # Update client current scene
elif scene_current != local_user_metadata['scene_current']: elif scene_current != local_user_metadata['scene_current']:
local_user_metadata['scene_current'] = scene_current local_user_metadata['scene_current'] = scene_current
session.update_user_metadata(local_user_metadata) porcelain.update_user_metadata(session.repository, local_user_metadata)
elif 'view_corners' in local_user_metadata and current_view_corners != local_user_metadata['view_corners']: elif 'view_corners' in local_user_metadata and current_view_corners != local_user_metadata['view_corners']:
local_user_metadata['view_corners'] = current_view_corners local_user_metadata['view_corners'] = current_view_corners
local_user_metadata['view_matrix'] = get_view_matrix( local_user_metadata['view_matrix'] = get_view_matrix(
) )
session.update_user_metadata(local_user_metadata) porcelain.update_user_metadata(session.repository, local_user_metadata)
class SessionStatusUpdate(Timer): class SessionStatusUpdate(Timer):