fix report error spreadsheet

pull/5/head
“christopheseux” 2023-06-21 12:57:16 +02:00
parent 4ae3f978bc
commit 83d34c2e67
1 changed files with 10 additions and 2 deletions

View File

@ -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"}