x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

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.

asset editor

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

right-click

Product Version: UE 4.15
Tags:
more ▼

asked Apr 25 '17 at 07:36 PM in C++ Programming

avatar image

DennyR
1.1k 31 12 47

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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

more ▼

answered Apr 26 '17 at 07:22 PM

avatar image

DennyR
1.1k 31 12 47

avatar image HollingsworthDan Aug 30 '18 at 06:13 PM

Thanks Denny. Just what I was looking for.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question