diff --git a/operators/spreadsheet.py b/operators/spreadsheet.py index 539c82a..f365b78 100644 --- a/operators/spreadsheet.py +++ b/operators/spreadsheet.py @@ -384,7 +384,7 @@ class VSETB_OT_import_spreadsheet(Operator): if cell_type == 'ASSET_TYPE' and spreadsheet.import_casting: - print(cell_value) + #print(cell_value) asset_names = cell_value.split('\n') # Clear the list of assets @@ -396,8 +396,11 @@ class VSETB_OT_import_spreadsheet(Operator): continue print(asset_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) + else: + asset = next((a for a in project.assets if norm_str(a.tracker_name) == norm_str(asset_name)), None) - asset = next((a for a in project.assets if norm_str(a.tracker_name) == norm_str(asset_name)), None) if asset: item = strip_settings.casting.add() item.name = asset.name