Hello,
When reimporting an FBX using interchange, the material are reapplied and we are stuck with the old properties. We are calling interchange by code, but we were able to repro by doing a reimport trough the asset browser UI. I've copied the code we use to trigger the import.
<pre class="ql-syntax" spellcheck="false">UInterchangeGenericAssetsPipeline* GenericAssetPipeline = nullptr;
if (const UInterchangeProjectSettings* InterchangeProjectSettings = GetDefault<UInterchangeProjectSettings>())
{
if (UInterchangeGenericAssetsPipeline* ConvertDefaultPipelineAsset = Cast<UInterchangeGenericAssetsPipeline>(InterchangeProjectSettings->ConverterDefaultPipeline.TryLoad()))
}
GenericAssetPipeline->MeshPipeline->bOneConvexHullPerUCX = true;
GenericAssetPipeline->MeshPipeline->bCreatePhysicsAsset = false;
GenericAssetPipeline->MeshPipeline->bBuildNanite = Data.EnableNanite;
GenericAssetPipeline->MeshPipeline->bCollision = !Data.DisableCollisionImport;
GenericAssetPipeline->ReimportStrategy = EReimportStrategyFlags::ApplyPipelineProperties;
GenericAssetPipeline->MeshPipeline->Collision = EInterchangeMeshCollision::None;
GenericAssetPipeline->MaterialPipeline->bImportMaterials = false;
GenericAssetPipeline->MaterialPipeline->SearchLocation = EInterchangeMaterialSearchLocation::AllAssets;
GenericAssetPipeline->MaterialPipeline->TexturePipeline->bImportTextures = false;
GenericAssetPipeline->CommonMeshesProperties->VertexColorImportOption = EInterchangeVertexColorImportOption::IVCIO_Ignore;
FImportAssetParameters ImportAssetParameters;
ImportAssetParameters.bIsAutomated = true;
ImportAssetParameters.bReplaceExisting = true;
ImportAssetParameters.OverridePipelines.Add(GenericAssetPipeline);
</pre>
Also, in interchange code, if the asset we are trying to import already exist, it is automatically converted in reimport (interchangemanager.cpp line 1825). I tried to trace as much as I can and I found the best solution was to prevent the conversion by forcing the bool. I think it will be our temp solution.
I've also tried to set
<pre class="ql-syntax" spellcheck="false">GenericAssetPipeline->MaterialPipeline->MaterialImport = EInterchangeMaterialImportOption::ImportAsMaterialInstances;
</pre>
but since we have the import material option to false, not sure if it changes something. In InterchangeGenericMaterialPipeline.cpp line 861, the _bIsMaterialInstance _value is set to true and the material in the FBX seems found.
I've tried to play with the _ReimportStrategy _settings without any success.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-253996 in the post.
0 |
Component | UE - Editor - Content Pipeline - Import and Export |
---|---|
Affects Versions | 5.5 |
Target Fix | 5.6 |
Created | Mar 4, 2025 |
---|---|
Updated | Mar 5, 2025 |