I try to create a Plugin with an editor module for a component Visualizer.
I have trouble in understanding and setting up the MyToolEditor.Build.cs
I want to extent an already existing Component Visualizer but this Visualizer is declared in the private Folder of the ComponentVisualizers Module.
My Question is, how could I access this? How can I include private header files of other Modules?
I tried something like this, but with no luck
PrivateIncludePaths.AddRange(
new string[] {
"MyToolEditor/Private",
"Editor/ComponentVisualizers/Private"
}
);
I’ve tried to do that in many ways without success, but finally nailed it!
This works for engine modules:
using System.IO; // Note this import, it's needed below
namespace UnrealBuildTool.Rules
{
public class Foo : ModuleRules
{
public Foo(TargetInfo Target)
{
// ...
// Get the engine path. Ends with "Engine/"
string engine_path = Path.GetFullPath(BuildConfiguration.RelativeEnginePath);
// Now get the base of UE4's modules dir (could also be Developer, Editor, ThirdParty)
string srcrt_path = engine_path + "Source/Runtime/";
// now you can include the module's private paths!
// as an example, you can expose UE4's abstraction of D3D11, located in Source/Runtime/Windows/D3D11RHI
PublicIncludePaths.Add(srcrt_path + "Windows/D3D11RHI/Private");
PublicIncludePaths.Add(srcrt_path + "Windows/D3D11RHI/Private/Windows");
}
}
}
I came across this post and figured I would add an example I see used in other Engine code. In my case I wanted to access private headers from Slate in my own Editor tool code. I added the following in by .Build.cs file: