C++/Editor. How to enable reimport for custom asset with UFactory?

Hey,

I created a custom asset and I can import it using my own UFactory. Importing the file works fine, it creates the asset and everything is working just fine. However, I can’t figure out how to enable the reimport functionality.

Things I have done so far:

I implemented FReimportHandler and it’s interface functions:

virtual bool CanReimport(UObject* Obj, TArray& OutFilenames) override; virtual void SetReimportPaths(UObject* Obj, const TArray& NewReimportPaths) override; virtual EReimportResult::Type Reimport(UObject* Obj) override; virtual int32 GetPriority() const override;

The Handler gets registered in the Editor.cpp file (in RegisterHandler()), so that part works. None of the interface functions are being called though. No breakpoint was hit.

I added UAssetImportData* AssetImportData; to my asset and I set the file path accordingly. The correct file path shows up when I hover over the asset in the editor.

When I right-click the asset, the reimport menu settings don’t show up.
I went through a few factories and their asset types and copied over pretty much everything that looked like it had anything to do with the reimport, but I still don’t get the thing to run. I am trying to track down why my Reimport functions aren’t being called, but no success so far.

Any help would be appreciated.

EDIT:

I just found that the import thing shows up in the actual asset editor and reimporting works fine.

when I right-click the asset, the import doesn’t show up, though.

Okay, I tracked the issue down. I had to implement my own FAssetTypeActions_Base and register it with the module.

Thanks Denny. Just what I was looking for.

How?