feat: get the replicated ui back
This commit is contained in:
@ -226,8 +226,6 @@ def unregister():
|
||||
operators.unregister()
|
||||
|
||||
del bpy.types.WindowManager.session
|
||||
del bpy.types.ID.id
|
||||
del bpy.types.ID.is_dirty
|
||||
|
||||
for cls in reversed(classes):
|
||||
bpy.utils.unregister_class(cls)
|
||||
|
@ -1,5 +1,6 @@
|
||||
__all__ = [
|
||||
'bl_object',
|
||||
'bl_mesh',
|
||||
] # Order here defines execution order
|
||||
|
||||
from . import *
|
||||
|
@ -6,6 +6,11 @@ from .. import utils
|
||||
from ..libs.replication.data import ReplicatedDatablock
|
||||
|
||||
class BlMesh(ReplicatedDatablock):
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.icon = 'MESH_DATA'
|
||||
|
||||
super().__init__( *args, **kwargs)
|
||||
|
||||
def load(self, data, target):
|
||||
if not target or not target.is_editmode:
|
||||
# LOAD GEOMETRY
|
||||
|
@ -5,6 +5,11 @@ from .. import utils
|
||||
from ..libs.replication.data import ReplicatedDatablock
|
||||
|
||||
class BlObject(ReplicatedDatablock):
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.icon = 'OBJECT_DATA'
|
||||
|
||||
super().__init__( *args, **kwargs)
|
||||
|
||||
def load(self, data, target):
|
||||
if target is None:
|
||||
pointer = None
|
||||
@ -43,7 +48,7 @@ class BlObject(ReplicatedDatablock):
|
||||
if not target_modifier:
|
||||
target_modifier = target.modifiers.new(data['modifiers'][modifier]['name'],data['modifiers'][modifier]['type'])
|
||||
|
||||
# utils.dump_anything.load(target_modifier, data['modifiers'][modifier])
|
||||
utils.dump_anything.load(target_modifier, data['modifiers'][modifier])
|
||||
|
||||
|
||||
def dump(self, pointer=None):
|
||||
|
Submodule libs/replication updated: 4310938b53...69df1e1f49
15
operators.py
15
operators.py
@ -24,21 +24,6 @@ logger = logging.getLogger(__name__)
|
||||
client = None
|
||||
|
||||
context = None
|
||||
execution_queue = queue.Queue()
|
||||
|
||||
# This function can savely be called in another thread.
|
||||
# The function will be executed when the timer runs the next time.
|
||||
|
||||
|
||||
# def run_in_main_thread(function, args):
|
||||
# execution_queue.put(function)
|
||||
|
||||
|
||||
# def execute_queued_functions():
|
||||
# while not execution_queue.empty():
|
||||
# function, args = execution_queue.get()
|
||||
# function(args[0], args[1])
|
||||
# return .1
|
||||
|
||||
|
||||
|
||||
|
30
ui.py
30
ui.py
@ -162,7 +162,7 @@ class SESSION_PT_user(bpy.types.Panel):
|
||||
|
||||
|
||||
def get_client_key(item):
|
||||
return item[0]
|
||||
return item.owner
|
||||
|
||||
class SESSION_PT_outliner(bpy.types.Panel):
|
||||
bl_idname = "MULTIUSER_PROPERTIES_PT_panel"
|
||||
@ -202,30 +202,22 @@ class SESSION_PT_outliner(bpy.types.Panel):
|
||||
if client_keys and len(client_keys) > 0:
|
||||
|
||||
for item in sorted(client_keys, key=get_client_key):
|
||||
owner = 'toto'
|
||||
try:
|
||||
owner = item[1]
|
||||
except:
|
||||
owner = item[1].decode()
|
||||
pass
|
||||
|
||||
store_type,store_name = item[0].split('/')
|
||||
item_box = area_msg.box()
|
||||
|
||||
detail_item_box = item_box.row(align = True)
|
||||
detail_item_box.label(text="",icon=ICONS[store_type])
|
||||
detail_item_box.label(text="{} ".format(store_name))
|
||||
detail_item_box.label(text="{} ".format(owner))
|
||||
detail_item_box.label(text="",icon=item.icon)
|
||||
detail_item_box.label(text="{} ".format(item.uuid))
|
||||
detail_item_box.label(text="{} ".format(item.owner))
|
||||
|
||||
right_icon = "DECORATE_UNLOCKED"
|
||||
if owner == net_settings.username:
|
||||
right_icon="DECORATE_UNLOCKED"
|
||||
else:
|
||||
# right_icon = "DECORATE_UNLOCKED"
|
||||
# if owner == net_settings.username:
|
||||
# right_icon="DECORATE_UNLOCKED"
|
||||
# else:
|
||||
|
||||
right_icon="DECORATE_LOCKED"
|
||||
# right_icon="DECORATE_LOCKED"
|
||||
|
||||
ro = detail_item_box.operator("session.right", text="",emboss=net_settings.is_admin, icon=right_icon)
|
||||
ro.key = item[0]
|
||||
# ro = detail_item_box.operator("session.right", text="",emboss=net_settings.is_admin, icon=right_icon)
|
||||
# ro.key = item[0]
|
||||
# detail_item_box.operator(
|
||||
# "session.remove_prop", text="", icon="X").property_path = key
|
||||
else:
|
||||
|
Reference in New Issue
Block a user