Hello Martin,
Thank you for having a look on my issue. I’m not sure to which level of description you are expecting on the structure of the folders (CorailKit is our reference and Unr is part of it). I joined to this message a basic framework without source and assets but included the uproject and uplugins.
CorailLib is mainly a container for all the assets that we could use in our different projects and is pretty basic. Normally, we do not include CorailLib in CorailKit (again, that was just a test to see if it would change the output and it did).
I also took the freedom to execute directly the commandlet, with UnrealEditor-cmd.exe as requested. I joined 2 logs. One with the problem and no call to the additional plugin (CorailLib) and the other one which includes the additional plugin and solves our issue.
Still, as you asked also the way I was calling the commandlet from the editor, here is the code :
`bool UUnrCookingCoreLauncher::DuplicateWorldPartitionMap(UWorld* WorldInput, USubworld* pSubWorld, const FString& NewPackageName)
{
FString strMapPackage = WorldInput->GetPackage()->GetName();
FString strSubWorldName = pSubWorld->GetSubworldName();
UClass* pDuplicateBuilderClass = UUnrCookingCoreDuplicateBuilder::StaticClass();
UEditorLoadingAndSavingUtils::NewBlankMap(false);
TStringBuilder<512> oCommandletArgsBuilder;
oCommandletArgsBuilder.Append(strMapPackage);
oCommandletArgsBuilder.Append(" “);
oCommandletArgsBuilder.Append(”-run=WorldPartitionBuilderCommandlet -Builder=“);
oCommandletArgsBuilder.Append(pDuplicateBuilderClass->GetName());
oCommandletArgsBuilder.Append(” “);
oCommandletArgsBuilder.Append(”-NewPackage=“);
oCommandletArgsBuilder.Append(NewPackageName);
oCommandletArgsBuilder.Append(” “);
oCommandletArgsBuilder.Append(”-SubWorldName=");
oCommandletArgsBuilder.Append(strSubWorldName);
FString strCommandletArgs(oCommandletArgsBuilder.ToString());
// Build the command line that will be launched by the process
FString strExecutablePath = FPlatformProcess::ExecutablePath();
FString strProjectPath = FPaths::IsProjectFilePathSet() ? FPaths::GetProjectFilePath() : FApp::GetProjectName();
FString strCommandLine;
strCommandLine += TEXT(“"”) + strProjectPath + TEXT(‘"’);
strCommandLine += TEXT(" -BaseDir="“) + FString(FPlatformProcess::BaseDir()) + TEXT('”');
strCommandLine += TEXT(" -Unattended");
strCommandLine += TEXT(" -RunningFromUnrealEd");
strCommandLine += TEXT(" ") + strCommandletArgs;
const bool bLaunchDetached = true;
const bool bLaunchHidden = true;
const bool bLaunchReallyHidden = true;
// Create new read/write pipes to retrieve the output of the process
void* pPipeRead = nullptr;
void* pPipeWrite = nullptr;
verify(FPlatformProcess::CreatePipe(pPipeRead, pPipeWrite));
UE_LOG(UnrCookingCoreLog, Display, TEXT(“Command for duplication: %s %s”), *strExecutablePath, *strCommandLine);
// Launch the process
FProcHandle oProcessHandle = FPlatformProcess::CreateProc(*strExecutablePath, *strCommandLine, bLaunchDetached, bLaunchHidden, bLaunchReallyHidden, nullptr, 0, nullptr, pPipeWrite, pPipeRead);
if (!oProcessHandle.IsValid())
{
UE_LOG(UnrCookingCoreLog, Error, TEXT(“Failed at duplicating production level process”));
return false;
}
// Print the output log of the process
while (FPlatformProcess::IsProcRunning(oProcessHandle))
{
const FString LogString = FPlatformProcess::ReadPipe(pPipeRead);
if (!LogString.IsEmpty())
UE_LOG(UnrCookingCoreLog, Display, TEXT(“%s”), *LogString);
FPlatformProcess::Sleep(0.1);
}
FPlatformProcess::ClosePipe(pPipeRead, pPipeWrite);
int pReturnCode;
FWindowsPlatformProcess::GetProcReturnCode(oProcessHandle, &pReturnCode);
if (pReturnCode)
{
UE_LOG(UnrCookingCoreLog, Display, TEXT(“RunUAT: Duplicating production level process failed with error code: %d”), pReturnCode);
return false;
}
// Reload the asset registry so that the HLODs directories appears in the Outliner
if (!IsRunningCommandlet())
{
// Force a directory watcher tick for the asset registry to get notified of the changes
FDirectoryWatcherModule& DirectoryWatcherModule = FModuleManager::Get().LoadModuleChecked(TEXT(“DirectoryWatcher”));
DirectoryWatcherModule.Get()->Tick(-1.0f);
// Force update before loading converted map
FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked(“AssetRegistry”);
IAssetRegistry& AssetRegistry = AssetRegistryModule.Get();
FString MapToLoad = strMapPackage;
TArray ExternalObjectsPaths = ULevel::GetExternalObjectsPaths(MapToLoad);
AssetRegistry.ScanModifiedAssetFiles({ MapToLoad });
AssetRegistry.ScanPathsSynchronous(ExternalObjectsPaths, true);
}
return true;
}`Hoping you could find something in these data that would explain my problem.
Thank you again,
Regards,
Philippe