What is you Workflow to adding code?

Hello guys,

What’s the workflow for most of you guys in adding code. Currently the Editor way of adding code is really annoying because it adds to the main folder both .cpp and .h
When dragging the code to the respective folder ( Via VS ) it doesn’t move the actual code from your System.

When dragging code from your system ( via Windows Explorer ). VS will no longer compile, saying cannot be found.

How do you manage this.

I still use the “Add Code to Project” via the editor, but since it kills my filter structure every time I add something, I kinda need to dig into this a bit. But I haven’t yet, I would be glad if anyone could enlighten me :stuck_out_tongue:

To add a basic class, go to File->Add Code To Project then select show all classes and select UObject. This will generate both the cpp and header file. Because UE4 regenerates the solution file (.sln) each time you add code to the project, it ignores any filters you may have created in Visual Studio’s solution explorer. If you want to force UE4 to use a folder layout, create the folders manually in Explorer in the solution’s source directory and organise your code however you like. When you regenerate the solution (File->Refresh Visual Studio Project), UE4 will recognise the folders and make the solution match accordingly.

FYI we will add an option to specify the destination folder in the Add Code to Project dialog. It won’t make it into the upcoming 4.1 release, but it should be in 4.2.

Here at Epic everybody uses a different method of adding files. Personally, I add all my files in Visual Studio. Occasionally, when cloning entire modules, I copy/create my files and directories in Windows Explorer (well, I actually use Total Commander) and then run the GenerateProjectFiles.bat batch file to update my VS solution.

Great! This has been bugging me for a while. Thanks for letting us know.

This is the method I use too :slight_smile:

I’ve never added code via the editor :slight_smile: