import unreal
file_path = r""
dst_path = ""
skeleton = unreal.load_asset("'")
source_data = unreal.InterchangeManager.create_source_data(file_path)
pipeline = unreal.InterchangeGenericAssetsPipeline()
import_asset_parameters = unreal.ImportAssetParameters()
import_asset_parameters.is_automated = True
import_asset_parameters.replace_existing = True
import_asset_parameters.override_pipelines.append(unreal.SoftObjectPath(pipeline.get_path_name()))
pipeline.common_skeletal_meshes_and_animations_properties.import_only_animations = True
pipeline.common_skeletal_meshes_and_animations_properties.skeleton = skeleton
interchange_manager = unreal.InterchangeManager.get_interchange_manager_scripted()
import_result = interchange_manager.import_asset(dst_path, source_data, import_asset_parameters)
import failded when using local skeleton var.
I found out that this is because the skeleton pointer was GC at an unknown time