folder_path = 'D:'
now_selects = unreal.EditorUtilityLibrary.get_selected_assets()
for now_asset in now_selects:
#Get file name
asset_name = now_asset.get_name()
print('asset_name = {0}'.format(asset_name))
#Get asset's import data
import_data = now_asset.get_editor_property("asset_import_data")
#Get asset's original source file path
source_files = import_data.extract_filenames()
print('source_files = {0}'.format(source_files))
#Set source file path
new_source_file = folder_path + '/' + asset_name + '.png' #Combine as you wish
source_files = import_data.scripted_add_filename(new_source_file,0,'')
1 Like