【UE4】导入文件
import unreal
texture_tga = "D:/ueMaterials/Pictures/Dog.png"
def importMyAssets():
texture_task = buildImportTask(texture_tga, '/Game/Textures')
executeImportTasks([texture_task])
def buildImportTask(filename, destination_path):
task = unreal.AssetImportTask()
task.set_editor_property('automated', True)
task.set_editor_property('destination_name', '')
task.set_editor_property('destination_path', destination_path)
task.set_editor_property('filename', filename)
task.set_editor_property('replace_existing', True)
task.set_editor_property('save', True)
return task
def executeImportTasks(tasks):
unreal.AssetToolsHelpers.get_asset_tools().import_asset_tasks(tasks)
importMyAssets()