fix: avoid to remove inexistant user widget
This commit is contained in:
parent
1a8bcddb74
commit
fc76b2a8e6
@ -305,11 +305,12 @@ class SessionUserSync(Timer):
|
||||
ui_users = bpy.context.window_manager.online_users
|
||||
|
||||
for index, user in enumerate(ui_users):
|
||||
if user.username not in session_users.keys():
|
||||
if user.username not in session_users.keys() and \
|
||||
user.username != self.settings.username:
|
||||
renderer.remove_widget(f"{user.username}_cam")
|
||||
renderer.remove_widget(f"{user.username}_select")
|
||||
renderer.remove_widget(f"{user.username}_name")
|
||||
ui_users.remove(index)
|
||||
renderer.remove_widget(f"{user}_cam")
|
||||
renderer.remove_widget(f"{user}_select")
|
||||
renderer.remove_widget(f"{user}_name")
|
||||
break
|
||||
|
||||
for user in session_users:
|
||||
@ -318,9 +319,12 @@ class SessionUserSync(Timer):
|
||||
new_key.name = user
|
||||
new_key.username = user
|
||||
if user != self.settings.username:
|
||||
renderer.add_widget(f"{user}_cam", UserFrustumWidget(user))
|
||||
renderer.add_widget(f"{user}_select", UserSelectionWidget(user))
|
||||
renderer.add_widget(f"{user}_name", UserNameWidget(user))
|
||||
renderer.add_widget(
|
||||
f"{user}_cam", UserFrustumWidget(user))
|
||||
renderer.add_widget(
|
||||
f"{user}_select", UserSelectionWidget(user))
|
||||
renderer.add_widget(
|
||||
f"{user}_name", UserNameWidget(user))
|
||||
|
||||
|
||||
class MainThreadExecutor(Timer):
|
||||
|
@ -417,7 +417,7 @@ class DrawFactory(object):
|
||||
if name in self.widgets:
|
||||
del self.widgets[name]
|
||||
else:
|
||||
logging.info("Widget {name} not existing")
|
||||
logging.error(f"Widget {name} not existing")
|
||||
|
||||
def clear_widgets(self):
|
||||
self.widgets.clear()
|
||||
|
Loading…
x
Reference in New Issue
Block a user