From ccd326fc7eb8e3a163188a5e7b61ef0235671650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cchristopheseux=E2=80=9D?= <“seuxchristophe@hotmail.fr”> Date: Mon, 22 May 2023 17:23:55 +0200 Subject: [PATCH] fix import custom_name --- operators/spreadsheet.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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