Python or Blueprint example for importing obj file in UE5.1, Interchange Import Pipeline

Okay, so we are diving one level deeper in interchange. With interchange you can hook between translation of file and creation of asset, as well as post asset creation etc.
So we are going to create a custom pipeline that will modify some of the information that is passed to the factories that will create assets before those factories are run:

  1. you can create a new Interchange blueprint pipeline base blueprint. You will use that blueprint to do extra work on your default interchange import.

  2. you override the event “Scripted Execute Pre import pipeline”.
    you had something like that. Note (1) we want to filter per “Interchange factory base node”. Those are factory node created by the first part of the pipeline and they will create the assets. You note we look for factory nodes for mesh, textures and materials and we rename assets depending on the type of the factory. (2) is another function you might like, it will add an extra folder to the path of the asset. I use it to put textures in a “texture” folder for example.

  3. Now, in a bug free world you should be able to just add that extra pipeline to the stack on import. Note you must still use the MyCustomObjAssetsPipeline and you should use it first in the stack => it is doing all the heavy lifting of import. The new blueprint you are adding is just tweaking nodes that are already created by previous pipeline

import_asset_parameters.override_pipelines.append(eas.load_asset("/Game/Interchange/MyDefaultAssetsPipeline"))
import_asset_parameters.override_pipelines.append(eas.load_asset("/Game/Interchange/BP_PrefixAsset"))

However you cannot add that custom blueprint to the override_pipelines array yet. We have a bug open for that.

  1. I can propose you instead to modify your default pipeline stack in Interchange settings and let “override_pipelines” empty for now.
    In project settings > Interchange, add a new stack in assets, put your two pipelines, and change the default pipeline stack

Now when you import into content folder (asset import) it will do your add prefix by default (import in UI, import in Blueprint, import in python, as long as you do not override pipelines)

  1. You can do the same thing for the scene import pipeline stack. Create a new pipeline stack, add the default mandatory two pipelines and add yours as the 3rd one. then change the default pipeline stack for the scene import
1 Like