To import a file as an asset you will need a few things:
-
Make UObject derived class that stores the data imported from the binary file (you might already have this).
-
Make a UFactory derived class to manage the importing. Implement FactoryCreateBinary() to process the file’s contents. See UTextureFactory as an example. Make sure you set bEditorImport=true and bCreateNew=false in the constructor. Also fill out the Formats array and set the SupportedClass to the class you made in step 1.
-
This is optional. Make an FAssetTypeActions derived class to provide the “Reimport” option when right clicking the asset in the content browser. See FAssetTypeActions_EditorUtilityBlueprint as an example of making one of these classes. You’ll need to register it in the StartupModule function for your module. An example of this is in BlutilityModule.cpp