From 83d34c2e67c15cc860f9ef4ccaef96c13d44a3ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cchristopheseux=E2=80=9D?= <“seuxchristophe@hotmail.fr”> Date: Wed, 21 Jun 2023 12:57:16 +0200 Subject: [PATCH] fix report error spreadsheet --- operators/spreadsheet.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/operators/spreadsheet.py b/operators/spreadsheet.py index fc3cc44..50c3243 100644 --- a/operators/spreadsheet.py +++ b/operators/spreadsheet.py @@ -324,6 +324,8 @@ class VSETB_OT_import_spreadsheet(Operator): spreadsheet = project.spreadsheet_import sequencer = scn.sequence_editor.sequences + assets_missing = [] + # Import Edit nb_frames_cell = next((c for c in spreadsheet.cells if c.import_name=='Nb Frames'), None) @@ -419,6 +421,8 @@ class VSETB_OT_import_spreadsheet(Operator): for asset_name in asset_names: if not asset_name: continue + + #print(norm_str(asset_name), norm_str(project.assets[0].tracker_name)) if spreadsheet.use_custom_name: asset = next((a for a in project.assets if norm_str(a.get('metadata', {}).get(spreadsheet.custom_name)) == norm_str(asset_name)), None) @@ -433,8 +437,12 @@ class VSETB_OT_import_spreadsheet(Operator): strip_settings.casting.update() else: - print(f'Asset {asset_name} not found in Project for strip {strip.name}') - self.report({'WARNING'}, f'Asset {asset_name} not found in Project for strip {strip.name}') + assets_missing.append(asset_name) + #print(f'Asset {asset_name} not found in Project for strip {strip.name}') + #self.report({'WARNING'}, f'Asset {asset_name} not found in Project for strip {strip.name}') + + if assets_missing: + self.report({'WARNING'}, f'Some assets were missing {assets_missing[:5]}...') return {"FINISHED"}