How do I access ProceduralMeshComponent.h header file?

I’m having difficulty getting my actor class to see the ProceduralMeshComponent.h. I’ve added the following to my Build.cs and still the header file is not found. What am I doing wrong? When I #include this it gets red squigleys underneath and says that it cannot be opened.

public class Game: ModuleRules
{
	public Game(TargetInfo Target)
	{
        PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "ProceduralMeshComponent" });
        PublicIncludePaths.AddRange(new string[] { "ProceduralMeshComponent/Public", "ProceduralMeshComponent/Classes" });
	}
}

Well for now I’ve just re-implemented the ProceduralMeshComponent as an extension of the MeshComponent. This appears to work. I wish I could just utilize the actual ProceduralMeshComponent.h. I’ll leave this unresolved until I can get that. I must not understand how to use a plugin as a template yet.

Any news here? I’m facing the same issue.

Try to also add the Private Dependency Module too in your Build.cs just after the PublicDependency:

PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "ProceduralMeshComponent" });
PrivateDependencyModuleNames.AddRange(new string[] { "ProceduralMeshComponent" });

And make sure the Procedural Mesh Component plugin is Enbled in the editor (under the menu Edit->Plugins->Rendering->Procedural mesh Component).

Does not work, he still cannot find ProceduralMeshComponent.h.

http://i.imgur.com/RvfIf8s.png

You need to add the PublicDependencyModuleName too, as Thumper did.

I did, that is what my build file looks like. (BTW thanks for helping me)

http://i.imgur.com/HJlpv4n.png

In my case, I can use the ProceduralMeshComponent.h header without including any path into PublicIncludePaths or PrivareIncludePaths. Try to remove those.

No same error. which version are you all using?

4.10. Try to create a subclass of ProceduralMeshComponent from the content browser.

There you go:

Weired… I’ll try that. Can you show me your build file? I created an empty C++ project maybe I’m missing something.

I’m still eager to find this out. It’s not really a big deal because I have it working by extending the meshComponent and just copy pasting all the procedural mesh component stuff into my own version.

Okay, I found a significant difference. When I use the header in my project it is found. But when I use it in my plugin within my project it is not found. Problem is that I need it in the plugin :wink:

Have you added the proceduralmeshcomponent (public+private) modules to your plugin’s build.cs? Is a different file from your project’s build.cs.

Okay I might have found a solution. Add the following additional dependency to your .uplugin file (or correspondingly to your .uproject file) in the module section:

"AdditionalDependencies": ["ProceduralMeshComponent"]

Furthermore, add ProceduralMeshComponent to your PrivateDependencyModuleNames array:

PrivateDependencyModuleNames.AddRange(new string[] {"Projects",..., "ProceduralMeshComponent"});

Works now :slight_smile:

It’s been awhile since I’ve tried fixing this so I had added a new question but realized I had already posted one (at least). So my solution before was to create a dummy class and just copy paste it all into there. This worked. But now many versions later I would like to fix it the right way. I’ve verified that ProceduralMeshComponent is in my .UProject. I’ve added it in my build.cs - both under public and private dependencies. The moment I add include “ProceduralMeshComponent.h” to my actor class header intelisense freaks out. Immediately under where the myactorclass.generated.h is listed the “UCLASS” has a red line under it. What is going on? Additionally I’ve checked that ProceduralMeshComponent is turned on as a plugin in the editor (don’t think this would stop visual studio from seeing a header file). I’ve gone through every post out there on what people do and they all say the same things. It appears many many people are solving this by making a dummy class and not officially including the version epic made. So whats the deal here?

True to form immediately after posting the above it worked. Not sure what did it, but good luck…

For me, using PrivateDependencyModuleNames didn’t work. It works with Public version of the variable instead.