fix import custom_name

pull/5/head
“christopheseux” 2023-05-22 17:23:55 +02:00
parent a14b28362f
commit ccd326fc7e
1 changed files with 5 additions and 2 deletions

View File

@ -384,7 +384,7 @@ class VSETB_OT_import_spreadsheet(Operator):
if cell_type == 'ASSET_TYPE' and spreadsheet.import_casting: if cell_type == 'ASSET_TYPE' and spreadsheet.import_casting:
print(cell_value) #print(cell_value)
asset_names = cell_value.split('\n') asset_names = cell_value.split('\n')
# Clear the list of assets # Clear the list of assets
@ -396,8 +396,11 @@ class VSETB_OT_import_spreadsheet(Operator):
continue continue
print(asset_name) 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: if asset:
item = strip_settings.casting.add() item = strip_settings.casting.add()
item.name = asset.name item.name = asset.name