Mutable scripts not finding included headers in Internal folders in 5.6 and failing to compile because of it

In upgrading our project to 5.6, we found that the includes referencing files in CustomizableObject/Internal or CustomizableObjectEditor/Internal folders were not compiling. They compiled when we had just the engine, but with our project added, which does include CustomizableObject scripts (some now located in the Internal folders), these compiler errors showed up.

Found broken includes in the following scripts:

CustomizableObject/Internal/MuCO/CustomizableObjectInstancePrivate.h

CustomizableObject/Internal/MuCO/CustomizableObjectPrivate.h

CustomizableObject/Internal/MuCO/CustomizableObjectSystemPrivate.h

CustomizableObjectEditor/Internal/MuCO/ICustomizableObjectEditorModulePrivate.h

CustomizableObjectEditor/Internal/MuCO/CompileRequest.h

CustomizableObjectEditor/Private/MuCO/CustomizableObjectCompiler.h

CustomizableObjectEditor/Private/MuCO/CustomizableObjectEditorModule.h

CustomizableObjectEditor/Private/MuCO/UnrealEditorPortabilityHelpers.h

CustomizableObjectEditor/Private/MuCO/GenerateMutableSource/GenerateMutableSource.h

CustomizableObjectEditor/Private/MuCO/Nodes/CustomizableObjectNodeTable.h

CustomizableObjectEditor/Public/MuCO/Nodes/CustomizableObjectNode.h

To resolve these compiler errors I had to change the includes to either start with CustomizableObject/Internal/ or CustomizableObjectEditor/Internal/.

Such as in the CustomizableObjectEditor\Private\MuCOE\CustomizableObjectCompiler.h file, I had to change

`#include “MuCO/CustomizableObjectPrivate.h”
include “MuCO/CustomizableObjectCompilerTypes.h”
include “MuCO/UnrealToMutableTextureConversionUtils.h”

to

include “CustomizableObject/Internal/MuCO/CustomizableObjectPrivate.h”
include “CustomizableObject/Internal/MuCO/CustomizableObjectCompilerTypes.h”
include “CustomizableObject/Internal/MuCO/UnrealToMutableTextureConversionUtils.h”`

Hi Kurt,

/Internal folder means that only /Engine can include those headers.

Recently we had a big overhaul of what we expose to public and what not. Everything located in /Private and /Internal should not be accessed outside the Mutable plugin. We have taken this decision to avoid constantly breaking outside code and allow us to be more flexible with changes.

I strongly recommend to only use the public API, which should be enough for most of the cases. If you still need to access /Private or /Internal you can always move these files but it will be at your own risk.

I changed our scripts to not reference the files in internal folders, but after doing so, I still get errors in the mutable engine files themselves - not our code:

`Error C1083 Cannot open include file: ‘ICustomizableObjectEditorModulePrivate.h’: No such file or directory \Game\Engine\Plugins\Mutable\Source\CustomizableObjectEditor\Private\MuCOE\CustomizableObjectEditorModule.h 5

Error C1083 Cannot open include file: ‘MuCO/UnrealPortabilityHelpers.h’: No such file or directory \Game\Engine\Plugins\Mutable\Source\CustomizableObjectEditor\Private\MuCOE\UnrealEditorPortabilityHelpers.h 6

Error C1083 Cannot open include file: ‘/MuCO/LoadUtils.h’: No such file or directory \Game\Engine\Plugins\Mutable\Source\CustomizableObjectEditor\Private\MuCOE\GenerateMutableSource\GenerateMutableSource.h 13

Error C1083 Cannot open include file: ‘/MuCO/LoadUtils.h’: No such file or directory \Game\Engine\Plugins\Mutable\Source\CustomizableObjectEditor\Private\MuCOE\GenerateMutableSource\GenerateMutableSource.h 13

Error C1083 Cannot open include file: ‘/MuCO/LoadUtils.h’: No such file or directory \Game\Engine\Plugins\Mutable\Source\CustomizableObjectEditor\Private\MuCOE\GenerateMutableSource\GenerateMutableSource.h 13

Error C1083 Cannot open include file: ‘/MuCO/LoadUtils.h’: No such file or directory \Game\Engine\Plugins\Mutable\Source\CustomizableObjectEditor\Private\MuCOE\GenerateMutableSource\GenerateMutableSource.h 13

Error C1083 Cannot open include file: ‘/MuCO/LoadUtils.h’: No such file or directory \Game\Engine\Plugins\Mutable\Source\CustomizableObjectEditor\Private\MuCOE\GenerateMutableSource\GenerateMutableSource.h 13

Error C1083 Cannot open include file: ‘/MuCO/LoadUtils.h’: No such file or directory \Game\Engine\Plugins\Mutable\Source\CustomizableObjectEditor\Private\MuCOE\GenerateMutableSource\GenerateMutableSource.h 13

Error C1083 Cannot open include file: ‘/MuCO/LoadUtils.h’: No such file or directory \Game\Engine\Plugins\Mutable\Source\CustomizableObjectEditor\Private\MuCOE\GenerateMutableSource\GenerateMutableSource.h 13`

Hi Kurt,

Looks like you are still including GenerateMutableSource.h, UnrealEditorPortabilityHelpers.h and CustomizableObjectEditorModule.h, which are private. It is possible that you are not including them directly but through another private / internal header. Is this the full list of compile errors?

Yeah, that is the full list.

We are including “MuCOE/CustomizableObjectEditorModule.h” and include “MuCOE/UnrealEditorPortabilityHelpers.h” in one of our scripts.

I can get rid of the use of “MuCOE/UnrealEditorPortabilityHelpers.h”.

But for “MuCOE/UnrealEditorPortabilityHelpers.h”, we need it in order to compile a CustomizableObject created in code:

`ICustomizableObjectEditorModule* EditorModule = ICustomizableObjectEditorModule::Get();

EditorModule->CompileCustomizableObject(*customizableObj, nullptr, true, false);`

If you want to compile a Customizable Object it is better to use void UCustomizableObject::Compile(const FCompileParams& Params). This functions is public and offers much more control.

If I want the compilation to be silent, how would I do that with that function?

Currently is not possible with this new API. If necessary you could expose it and pass it to FCompilationRequest. In there you will find the bSilentCompilation.