Reanimating this thread after such a long time… But it’s exactly the problem I have.
I’d suggest to modify UFactory::FactoryCanImport() by the following code snippet:
bool UFactory::FactoryCanImport( const FString& Filename )
{
bool CanImport = false;
FString FileExtension = FPaths::GetExtension(Filename);
for (const auto& Format : Formats)
{
const int32 DelimiterIdx = Format.Find(TEXT(";"));
if ((DelimiterIdx != INDEX_NONE) && (Format.Left(DelimiterIdx) == FileExtension))
{
CanImport = true;
break;
}
}
if (CanImport && FileExtension == TEXT("t3d"))
followed by the t3d-handling stuff.
That way, FactoryCanImport just checks for the extension string (case sensitive, as I just realize) being listed in the Formats array. That array is supposed to be filled by the derived Factory classes.
Is there anything, that would render that approach to be wrong? For me, it seems to be “just the right thing” ™.