Is it possible to add class without the editor?

Or not to compile code every time I add a new class.

Hey Adflixit-

It is possible to add new classes through Visual Studios by adding new files to the solution. The benefit to adding a class through the editor is that it will setup a lot of the required code automatically (includes, UCLASS, constructor, etc). However adding classes through the editor will trigger the code to compile, so if you are trying to avoid this you would have to create the new file through VS and setup this information manually.

Cheers

But what about “*.generated.h” stuff? Will it work?

Adding classes manually works the same as when added through the editor, however you must pay attention to several details, when adding classes manually:

  • In Visual Studio using “Add New Item” will have the Intermediate folder selected by default, which you must change to the actual source folder, or otherwise you won’t be able to add these files to source control (and probably other bad things happen…)

  • You manually have to adhere to UHT standards, like including the “*.generated.h” file (however UHT will tell you, if you did something wrong)

  • If you add a file on the file system directly, you have to either drag&drop it into your Visual Studio solution, or run “Generate Project Files” for UHT to pick up your newly added file.

In short: Yes, “*.generated.h” stuff will work, if done correctly :wink:

-Elewyth

Many thanks!