From de1e684b3cafe300eec23b5df658cd053d7e9214 Mon Sep 17 00:00:00 2001 From: Swann Date: Thu, 24 Jun 2021 14:35:59 +0200 Subject: [PATCH] fix: name filtering --- multi_user/ui.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/multi_user/ui.py b/multi_user/ui.py index 5e97f11..1523f2d 100644 --- a/multi_user/ui.py +++ b/multi_user/ui.py @@ -555,20 +555,15 @@ class SESSION_PT_repository(bpy.types.Panel): # Properties owned_nodes = [k for k, v in session.repository.graph.items() if v.owner==settings.username] - filtered_node = owned_nodes if runtime_settings.filter_owned else session.repository.graph.keys() + filtered_node = owned_nodes if runtime_settings.filter_owned else list(session.repository.graph.keys()) if runtime_settings.filter_name: - for node_id in filtered_node: - node_instance = session.repository.graph.get(node_id) - name = node_instance.data.get('name') - if runtime_settings.filter_name not in name: - filtered_node.remove(node_id) + filtered_node = [n for n in filtered_node if runtime_settings.filter_name.lower() in session.repository.graph.get(n).data.get('name').lower()] if filtered_node: col = layout.column(align=True) for key in filtered_node: draw_property(context, col, key) - else: layout.row().label(text="Empty")