Hi Jason,
Unfortunately, none of the helpers using the legacy FBX importer to import different specific assets, like UEditorEngine::ImportFbxAnimation, has been updated to use Interchange when it is enabled. This is on our todo list but we do not have any ETA on when they will be updated.
Additionally, the call to ImportAssetsAutomated does not work as Interchange does not detect the skeleton to use.
I looked into the code and it looks like you need to do a little bit more for UEditorEngine::ImportFbxAnimation to work. Here is what I think would work:
`// Assuming that bImportMorphTracks, Skeleton and AssetName are set
UFbxAnimSequenceImportData* ImportData = NewObject();
FFbxImporter* FbxImporter = UnFbx::FFbxImporter::GetInstance();
UnFbx::FBXImportOptions* ImportOptions = FbxImporter->GetImportOptions();
UnFbx::FBXImportOptions::ResetOptions(ImportOptions);
ImportOptions->bImportAnimations = true;
ImportOptions->bImportMaterials = true;
ImportOptions->bImportTextures = true;
ImportOptions->bImportBoneTracks = true;
ImportOptions->bImportCustomAttribute = true;
ImportOptions->bUsedAsFullName = true;
ImportOptions->bConvertScene = true;
ImportOptions->bAddCurveMetadataToSkeleton = true;
ImportOptions->bDoNotImportCurveWithZero = true;
ImportOptions->bRemoveRedundantKeys = true;
ImportOptions->bResample = true;
ImportOptions->MaterialCurveSuffixes.Emplace(TEXT(“_mat”));
ImportOptions->ImportType = FBXIT_Animation;
ImportOptions->SkeletonForAnimation = Skeleton;
UAnimSequence* AnimSequence = UEditorEngine::ImportFbxAnimation(Skeleton, (UObject*)GetTransientPackage(), ImportData, FbxFileName, AssetName, bImportMorphTracks);`With Interchange enabled, you could try the pseudo code below. It should emulate what ImportFbxAnimation is doing but with Interchange. Not optimal, but hopefully, this will help you with what you are trying to do.
`// Use the DefaultAssetsPipeline asset as a base
static const FSoftObjectPath GenericPipelinePath(TEXT(“/Interchange/Pipelines/DefaultAssetsPipeline.DefaultAssetsPipeline”));
UInterchangeGenericAssetsPipeline* AssetPipeline = Cast(GenericPipelinePath.TryLoad());
// Duplicate it in order to modify it locally
UInterchangeGenericAssetsPipeline* DuplicatePipeline = DuplicateObject(AssetPipeline, GetTransientPackageAsObject());
// Set your duplicate to only import animation with a given skeleton
// Disable what is not desired
DuplicatePipeline->MaterialPipeline->bImportMaterials = false;
DuplicatePipeline->MaterialPipeline->TexturePipeline->bImportTextures = false;
DuplicatePipeline->MeshPipeline->bImportStaticMeshes = false;
// Make sure only animation is imported.
DuplicatePipeline->AnimationPipeline->bImportAnimations = true;
DuplicatePipeline->MeshPipeline->bImportSkeletalMeshes = true;
DuplicatePipeline->MeshPipeline->bImportMorphTargets = [false|true];
DuplicatePipeline->CommonSkeletalMeshesAndAnimationsProperties->bImportOnlyAnimations = true;
DuplicatePipeline->CommonSkeletalMeshesAndAnimationsProperties->Skeleton = Skeleton;
// Create an Interchange pipeline override to set it as an option to your UAssetImportTask.
// Interchange will collect those overrides and use them to import
UInterchangePipelineStackOverride StackOverride = NewObject();
StackOverride->AddPipeline(DuplicatePipeline);
UAssetImportTask* ImportTask = NewObject();
ImportTask->bAutomated = true;
ImportTask->Options = StackOverride;
// Set up the other members of ImportStack based on your needs, i.e. DestinationPath, DestinationName, etc…
for(FString& Filename : Filenames)
{
ImportTask->Filename = Filename;
IAssetTools::Get().ImportAssetTasks({ImportTask});
}` Let me know how it goes.
Regards,
Jean-Luc.