feat(rcf): get user panel back

This commit is contained in:
Swann Martinez 2019-04-17 13:39:36 +02:00
parent 44b077fbce
commit a6dce98173
No known key found for this signature in database
GPG Key ID: 414CCAFD8DA720E1
2 changed files with 24 additions and 23 deletions

View File

@ -30,7 +30,7 @@ update_list = {}
SUPPORTED_DATABLOCKS = ['collections', 'meshes', 'objects',
'materials', 'textures', 'lights', 'cameras', 'actions', 'armatures', 'grease_pencils']
SUPPORTED_TYPES = [ 'Material',
SUPPORTED_TYPES = ['Material',
'Texture', 'Light', 'Camera','Mesh', 'Grease Pencil', 'Object', 'Action', 'Armature','Collection', 'Scene']
# UTILITY FUNCTIONS
@ -150,6 +150,7 @@ def draw_tick():
drawer.draw()
# refresh_window()
# Upload
upload_client_instance_position()
return 1

22
ui.py
View File

@ -81,7 +81,7 @@ class SessionUsersPanel(bpy.types.Panel):
@classmethod
def poll(cls, context):
if operators.client_instance:
return operators.client_instance.status == client.RCFStatus.CONNECTED
return operators.client_instance.agent.is_alive()
return False
def draw(self, context):
@ -91,23 +91,23 @@ class SessionUsersPanel(bpy.types.Panel):
scene = context.scene
# Create a simple row.
row = layout.row()
if operators.client_instance:
if len(operators.client_instance.property_map) > 0:
for key, values in operators.client_instance.property_map.items():
if 'client' in key:
if operators.client_keys and len(operators.client_keys) > 0:
for key in operators.client_keys:
if 'Client' in key:
info = ""
item_box = row.box()
detail_item_box = item_box.row()
if values.id == operators.client_instance.id:
username = key.split('/')[1]
if username == net_settings.username:
info = "(self)"
# detail_item_box = item_box.row()
detail_item_box.label(
text="{} - {}".format(values.id.decode(), info))
text="{} - {}".format(username, info))
if operators.client.id.decode() not in key:
if net_settings.username not in key:
detail_item_box.operator(
"session.snapview", text="", icon='VIEW_CAMERA').target_client = values.id.decode()
"session.snapview", text="", icon='VIEW_CAMERA').target_client = username
row = layout.row()
else:
row.label(text="Empty")
@ -127,7 +127,7 @@ class SessionPropertiesPanel(bpy.types.Panel):
def poll(cls, context):
if operators.client_instance:
return operators.client_instance.agent.is_alive()
# return operators.client.status == client.RCFStatus.CONNECTED
return False
def draw(self, context):
@ -201,7 +201,7 @@ class SessionTaskPanel(bpy.types.Panel):
classes = (
SessionSettingsPanel,
# SessionUsersPanel,
SessionUsersPanel,
SessionPropertiesPanel,
# SessionTaskPanel,
)