Include Plugin in C++

Dear fellow UE users,

I’m currently working on a project where I need to include a plugin (ProceduralMeshComponent) in C++.

But the complier keeps throwing me errors, that it cannot find UProceduralMeshComponent.

Here is what I did so far to include it :

  1. I edited <ProjectName>.Build.cs :

Added :

PrivateDependencyModuleNames.AddRange(new string] { “ProceduralMeshComponent” });
PrivateIncludePathModuleNames.AddRange(new string] { “ProceduralMeshComponent” });

And edited :

  1. Also I tried to include the header file itself by following lines (of corse not at the same time):

#include “ProceduralMeshComponent.h”
#include “Engine/Plugins/Runtime/ProceduralMeshComponent/Source/Public/ProceduralMeshComponent.h”
#include “…/…/Engine/Plugins/Runtime/ProceduralMeshComponent/Source/Public/ProceduralMeshComponent.h”

The last one does not throw an error itself, but VS still crashes because it cannot find UProceduralMeshComponent when I try to compile.

  1. Edited the DefaultEngine.ini for activ Plugins and added there :

[Plugins]
EnabledPlugins=ProceduralMeshComponent

Of course I checked the forum for help and best advice was here:

Which obviously did not help, because the problem still exists.

Please guys, I need your help !

Oh, and Blueprint is not really a solution because we need to have C++ access to the object and it’s methods without jumping back and forth between BP and C++.

What do I miss ? How do I include a Plugin in C++ ?

I believe this procedural mesh component plugin is not available via C++, blueprint is the only way to go.
You could try copying the plugin to your project and just change all the class and function names, etc. I don’t know.

Yes, sadly it seems thats the only way to go.

You can do Procedural Meshes in UE4 C++ without including any plugins, there’s a 10-page long thread around here on procedural meshes somewhere…

As TheJamsh mentioned, you don’t need the ProceduralMeshComponent to do procedural meshes in C++, you can just build your own component, and scene proxy (for the rendering) and fill it with whatever data you want and render it the way you want to (within reason).

About everything you need to know regarding procedural meshes in UE4 is in this thread: Generate Procedural Mesh - C++ Gameplay Programming - Unreal Engine Forums

Using ProceduralMeshComponent in C++ in UE4.10 is in fact possible and really easy, just follow this quick start guide on the Wiki (just discovered it this evening)

Well. I’m having the same issue (include file not found) with that tutorial. I just updated it to 4.18 and suddenly stopped working !

4.10 came out over two years ago (this thread is also nearly two years old btw - would have been better to create a new one). You should expect some teething problems. Plugins had a lot of changes around 4.16/4.17 or so - it’s worth looking them up. Lot’s of things will have moved by now.

Hello,

I’m using UE4.18 and I would like to use the OculusHMD module from the OculusVR plugin.
I have tried the same steps as described above and I’m still not able to include the OculusFunctionLibrary.h.
I really need the GetRawSensorData() function in C++ to work.

Did someone already find a solution for this?

1 Like