feat: object watchdog test
This commit is contained in:
@ -65,6 +65,10 @@ class BlObject(ReplicatedDatablock):
|
||||
object_name = self.buffer['name']
|
||||
|
||||
self.pointer = bpy.data.objects.get(object_name)
|
||||
|
||||
def diff(self):
|
||||
return self.pointer.location != self.buffer['location']
|
||||
|
||||
bl_id = "objects"
|
||||
bl_class = bpy.types.Object
|
||||
bl_rep_class = BlObject
|
||||
|
@ -24,13 +24,9 @@ class BlUser(ReplicatedDatablock):
|
||||
|
||||
def dump(self,pointer=None):
|
||||
return utils.dump_anything.dump(pointer)
|
||||
# def load(self, data, target):
|
||||
# pass
|
||||
|
||||
|
||||
# def dump(self, pointer=None):
|
||||
# pass
|
||||
|
||||
def diff(self):
|
||||
pass
|
||||
|
||||
bl_id = "user"
|
||||
bl_class = User
|
||||
|
Submodule libs/replication updated: 2cb2569fff...6cf163da86
@ -147,7 +147,11 @@ class SessionStartOperator(bpy.types.Operator):
|
||||
for type in bl_types.types_to_register():
|
||||
_type = getattr(bl_types, type)
|
||||
supported_bl_types.append(_type.bl_id)
|
||||
bpy_factory.register_type(_type.bl_class, _type.bl_rep_class)
|
||||
|
||||
if _type.bl_id == 'objects':#For testing
|
||||
bpy_factory.register_type(_type.bl_class, _type.bl_rep_class, timer=2,automatic=False)
|
||||
else:
|
||||
bpy_factory.register_type(_type.bl_class, _type.bl_rep_class)
|
||||
|
||||
client = Client(factory=bpy_factory)
|
||||
|
||||
|
6
ui.py
6
ui.py
@ -1,6 +1,7 @@
|
||||
import bpy
|
||||
from . import operators
|
||||
from .libs.replication.constants import *
|
||||
from .bl_types.bl_user import BlUser
|
||||
|
||||
|
||||
ICONS = {'Image': 'IMAGE_DATA', 'Curve':'CURVE_DATA', 'Client':'SOLO_ON','Collection': 'FILE_FOLDER', 'Mesh': 'MESH_DATA', 'Object': 'OBJECT_DATA', 'Material': 'MATERIAL_DATA',
|
||||
@ -10,7 +11,8 @@ PROP_STATES = [ 'ADDED',
|
||||
'COMMITED',
|
||||
'PUSHED',
|
||||
'FETCHED',
|
||||
'UP']
|
||||
'UP',
|
||||
'CHANGED']
|
||||
class SESSION_PT_settings(bpy.types.Panel):
|
||||
"""Settings panel"""
|
||||
bl_idname = "MULTIUSER_SETTINGS_PT_panel"
|
||||
@ -155,7 +157,7 @@ class SESSION_PT_user(bpy.types.Panel):
|
||||
# Create a simple row.
|
||||
col = layout.column(align=True)
|
||||
|
||||
client_keys = operators.client.list(filter='BlUser')
|
||||
client_keys = operators.client.list(filter=BlUser)
|
||||
if client_keys and len(client_keys) > 0:
|
||||
for key in client_keys:
|
||||
area_msg = col.row(align = True)
|
||||
|
Reference in New Issue
Block a user