From 5830fe1abb06cf2f6f1973bc0f05bac5ad83cf12 Mon Sep 17 00:00:00 2001 From: Fabian Date: Wed, 16 Jun 2021 14:28:26 +0200 Subject: [PATCH] fix: add `items_to_remove` --- multi_user/utils.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/multi_user/utils.py b/multi_user/utils.py index c8539b6..adae5c4 100644 --- a/multi_user/utils.py +++ b/multi_user/utils.py @@ -106,9 +106,12 @@ def clean_scene(): try: sub_collection_to_avoid = [bpy.data.linestyles['LineStyle'], bpy.data.materials['Dots Stroke']] type_collection = getattr(bpy.data, type_name) - for item in type_collection: - if item not in sub_collection_to_avoid : - type_collection.remove(item) + items_to_remove = [i for i in type_collection if i not in sub_collection_to_avoid] + for item in items_to_remove: + try: + type_collection.remove(item) + except: + continue except: continue