Proejct based plugin's verse package do not generate and is not visible in UE6-main

Summary

After replicate the verse component based on engine’s DamageableComponent verse component by change its name to be DamageableComponent1 and also the respectives also is updated in project’s plugin, it is not visible in addcomponent menu of entities prefab. . After dig into engine code,found that

FNativeFileGenerator::EmitVniPackageDescs (G:\UE6\UnrealEngine\Engine\Source\Programs\Solaris\VerseNativeInterfaceGen\Private\NativeFileGenerator.cpp) had no fallback when the Verse dir can’t be expressed relative to the engine binary dir. With project on F: and engine on G:, the generated registrar got TEXT(“”), so at runtime the native Verse packages registered 0 UTypes — the plugin’s Verse package/classes (damageable_component1 etc.) were never found.

What Type of Bug are you experiencing?

Foundation (C++ Tools, Profiling, & Pipeline)

Steps to Reproduce

GitHub - franklzt/NativeDemo: UE6 Native Verse Component Test · GitHub, just clone the project and build with ue6-main branch, the project should be place the same driver to the engine source location,and the project should not be place the same driver to the engine source location. find if DamageableComponent1 can be found from the entities prefab addcomponent menu.

Expected Result

Verse compoent in project’s plugin source folder should be visible from menu of add verse component 's menu list. regardless the location of project is the same or not the same to the engine’s source location.

Observed Result

Verse component live in project’s plugin source code is not visible from addcomponent list

Affects Versions

5.8

Platform(s)

Windows

Additional Notes

the bug is for ue6-main

Apply only this change to NativeFileGenerator.cpp in EmitVniPackageDescs (same patch you already validated locally)

Root cause (before → after), in FNativeFileGenerator::EmitVniPackageDescs:

// bug: no fallback when the relative conversion fails (project F:, engine G:)
if (BaseDirectory.IsFilled())
{
    RelativeVerseDirectory = FilePathUtils::ConvertFullPathToRelative(VstPackage._DirPath, BaseDirectory);
}
else
{
    Diagnostics.AppendGlitch("Couldn't find base directory for package %s.", *VstPackage._Name);
    RelativeVerseDirectory = VstPackage._DirPath;
}
// fix
if (BaseDirectory.IsFilled())
{
    RelativeVerseDirectory = FilePathUtils::ConvertFullPathToRelative(VstPackage._DirPath, BaseDirectory);
    if (RelativeVerseDirectory.IsEmpty())
    {
        // Cross-drive case (project and engine on different drives): fall back to absolute.
        RelativeVerseDirectory = VstPackage._DirPath;
    }
}