Problem using AssetTypeCtegories.h in my custom module editor

Hi guys ! :slight_smile:

I’ve little problem in C++. I’m really new to the C++ API of UE4, and for my game’s project (tactical RPG), I wanted to create a tool (or even just a C++ class) which could be run in the editor, and where we could change two values : NumberRaws and NumberColomns, to generate on the fly a grid, directly in the map view of the editor.

So I’ve made my custom editor’s config, everything is compiled and work fine. After that, I decided to look at that tutorial : http://orfeasel.com/creating-custom-editor-assets/, to create a custom asset called “Grid” which could be my C++ class to generate the grid on the fly, directly in the editor.

So I added all of that C++ classes on my module’s directory (Grid.cpp/Grid.h and UGridFactory.cpp/UGridFactory.h). After that, I included “AssetTools” in the public dependencyModulesNames of my module Build.cs file. But here is the problem, when I include “AssetTypeCategories.h” in my Grid.cpp file (which is the class which handles the grid generation on the fly), that’s not recognized.

I’m certainly doind wrong things in one step, but where ? I really don’t know. Any help is appreciate guys :slight_smile: Thank you really really much in advance !

Victor

After adding AssetTools did you close the editor and regenerated the project files? (Right click on uproject and select Generate Visual Studio project files).

Yes, I did that twice to be sure. But with no consequences ;(
#include “AssetTypeCategories.h”; is still not recognized after regeneration.

You don’t need that semicolon for include. I just tried adding include “AssetTypeCategories.h” into my test project and it compiled successfully (4.17 p3) after adding “AssetTools” into the build file.

Oh sorry, that was a mistake :slight_smile: No, I don’t have that “;” in my code.
Still have the problem… ;(
But did you try to add AssetTypesCategories.h in a module which launch in the editor ? Maybe the problem come from here, don’t you think ?

Are you sure that’s correct? I have it included like this:

aqTXesR.png

Though I don’t remember why that is. I think it’s just because I saw it done like this in engine modules.

Oh wait, I didn’t include DynamicallyLoadedModulesNames, it’s probably because of that !
I just add the module like “UnrealEd”… with PublicIncludePathModuleNames.AddRange(new string] { “AssetTools” });

I did that because I follow the tutorial I linked before. Quote : “In order to access the AssetTypeCategories.h file you need to add the “AssetTools” in your project’s public dependencies:” And that works for him. But he doesn’t have that code in a custom module.