Render sequences

This commit is contained in:
ChristopheSeux
2024-03-14 17:44:05 +01:00
parent 688a06dffd
commit ac14fe5ba9
9 changed files with 237 additions and 91 deletions
+13 -5
View File
@@ -147,6 +147,7 @@ class VSETB_OT_spreadsheet_from_file(Operator):
sheet = workbook.active
rows = [[(c.value or '') for c in r] for r in sheet.rows]
workbook.close()
else:
self.report({'ERROR'}, f'File extension {filepath.suffix} should be in [.csv, .xlsx]')
@@ -162,11 +163,15 @@ class VSETB_OT_spreadsheet_from_file(Operator):
cell = import_cells.add()
cell.name = cell_name
if cell_types.get(cell_name):
cell.import_name = cell_name
continue
matches = [(k, fuzzy_match(cell_name, k)) for k in cell_types.keys()]
best_name, best_match = max(matches, key=lambda x: x[1])
cell.import_name = best_name
cell.enabled = best_match > 0.75
cell.enabled = best_match > 0.85
project.spreadsheet_import.use_custom_cells = True
@@ -338,7 +343,7 @@ class VSETB_OT_import_spreadsheet(Operator):
spreadsheet = project.spreadsheet_import
sequencer = scn.sequence_editor.sequences
assets_missing = []
assets_missing = set()
# Import Edit
nb_frames_cell = next((c for c in spreadsheet.cells if c.import_name=='Nb Frames'), None)
@@ -371,7 +376,7 @@ class VSETB_OT_import_spreadsheet(Operator):
if spreadsheet.update_edit and (nb_frames_cell and nb_frames_cell.enabled):
nb_frames = int(cell_data['Nb Frames'])
print('Import Edit')
#print('Import Edit')
#print(frame_start, nb_frames, type(nb_frames))
frame_end = frame_start + nb_frames
@@ -464,12 +469,15 @@ class VSETB_OT_import_spreadsheet(Operator):
strip_settings.casting.update()
else:
assets_missing.append(asset_name)
assets_missing.add(f'{cell_name} / {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]}...')
print('Some assets were missing')
for asset in sorted(assets_missing):
print(asset)
self.report({'WARNING'}, f'Some assets were missing {list(assets_missing)[:5]}...')
return {"FINISHED"}