How to set up the plugin for multiple modules

Allow me to use someone else’s structural diagram

+Project
   + Plugins
      + MyPlugin
         + Source
            + Developer
               + Module1
               + Module2
               + ......
            + Editor
               + Module3
               + Module4
            + ThirdParty
               + Module5
               + Module6

The file is structured like this.
Generate VS project files gives me an error when I add the relevant module to .uplugin:

Exception while generating include data for ProjectEditor: Could not find definition for module 'Module1', (referenced via default plugins -> Plugins.uplugin)

When I move the module to the top level folder, it works fine.

+Project
   + Plugins
      + MyPlugin
         + Source
            +  Module1

I’m sure I’m doing something wrong somewhere, but I don’t know what it is, so I’m asking for help.
The modules all have .Build.cs / Module.cpp.
Module.cpp has also added the

IMPLEMENT_MODULE(FDefaultModuleImpl, Module1);

HI, I found the solution:

Comment out the other modules in .uplugin, "Generate VS project files" once.
Close the plugin and "Generate VS project files" again.
With the plugin closed, go to .sln and edit the .uplugin again, then UBT will find the Modules successfully.

This is a really strange problem.

1 Like