Reimport Logging not showing up

I’m writing a plugin to import custom assets as meshes, materials, and more. The importer is working just fine, but I’m often having to reimport data as I expand the supported formats, or fix issues I’ve found when reading the data. However, I can’t find a decent step-by-step tutorial for making a c++ reimport system that works. I got it so I can call the functions natively (using the built-in Reimport buttons) but every attempt to run the reimport function returns EReimportResult::Failed.

Now, normally, I would just log my way to a solution, but my current issue is that any call to UE_LOG fails to output anything when overriding FReimportHandler::Reimport. I have a log call at the very beginning of the function, (just to see if it’s running) and nothing shows up in my logs. As such, I can’t debug the issue.

Is there a solution where I can log a reimport function so I can debug it? Alternatively, can anyone think of why my override of FReimportHandler::Reimport wouldn’t be called?

Hi Kjasi,

Does it trigger a break-point if you set one there?

Huh, no it does not…

So it looks like when reimporting, it doesn’t even use the correct factory…

Should of realized this when every time I called reimport, it asks for a file to import… Now to figure out how to get it to use the correct factory when reimporting… Trying to follow the FBX and Alembic source codes as references…

Yeah, I’m not even getting logging for the CanReimport function…

What about in FReimportManager::CanReimport - does it trigger a breakpoint in there? Is your handler in the list?

No, it didn’t hit CanReimport. Nor SetReimportPaths. But it DID hit GetPriority like 11 times, but only AFTER it asked for the new file location.

What list are you referring to?

In Editor.cpp, the entry point for the CanReimport:

Okay, how do I check that?

Wait, Think I have it…

Yes, my factory is listed in there. As is my FReimportHandler.

Edit: For people wondering how I checked the list, I set a breakpoint on that line in Editor.cpp, and checked the variables when the breakpoint hit.

Then it sounds like something earlier in the list is saying it can reimport it?

If you step through that part of the code you should be able to find what it is…

1 Like

Ah! I think I found the problem! Another importer in the same plugin has CanReimport doing return true, so… Gonna fix it and see if that solves the issue.

That was the issue. It’s now calling the Reimport function & logging is working now! Thank you!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.