I am currently using perforce and testing the simplest thing possible with my colleague. On his end, he creates an empty Object class, then pushes it to source control. When I get latest, that file does not show up in the editor in the C++ classes folder.
I understand that steps must be taken to propagate the changes to the editor. But so far, I cannot find documentation that lines out the exact necessary steps to do so. All I find are other answers in the UE4 answer HUB that all claim to have a solution, but they contradict each other and don’t seem to work for everyone.
Is there anyone out there that can clear this up exactly?
This seems like an absolutely fundamental and simple piece of functionality that is not streamlined even remotely. Additionally, when deleting a class, the same problem persists. Yes, we have tried clean-building the solution in VS and relaunching the editor. That does not seem to work for me.
I really hope that it is not necessary to nuke all binaries, close all programs, rebuild, and reopen everything just to get a new class to propagate to the editor. If that’s the case, then this is another notch on the belt of atrocious workflow that really slows down the development of a project.
Please tell me that we are just doing something incredibly stupid here.
Sincerely,
Frustrated
Hello manbearpug,
In the event of changes to C++ and source control, only merging the code file won’t end in the results you’re looking for. If you want these changes to be reflected, the person merging the new C++ changes will need to compile and also upload the .dlls generated.
If you will also be changing code or need to view code, you also may need him to merge his intermediates / .sln files as those will need to be generated manually otherwise whenever any C++ class is added to the source folders.
This is the same thing that would happen if you manually add a new .h / .cpp file to your source directory. Normally the C++ Class Wizard takes care of regenerating the project files and doing a compile for you. If not using the wizard, that would need to be done manually for the reflection to take place.
Thanks for the response!
I understand the need to compile or even build the DLL’s. But I’m specifically asking for the steps, and only the exact necessary steps to get a manually added class to display in the C++ classes directory.
My issue is that many people claim that it requires, a DLL nuke, re-compile, re-build, AND to shut down both VS and Unreal Engine. It’s mainly the last couple steps that bother me the most.
It takes quite a while to perform all of those steps, and seems a little ridiculous that the engine doesn’t have a way to refresh the c++ classes after a rebuild. We’ve been experimenting with all sorts of different combinations of steps to see which ones are absolutely necessary and which ones are not, but we’re still hoping someone has already gone through this and is willing to shed light on what seems like a very slow workflow.
If I’m currently in the editor, with the solution open in VS and a partner syncs only the .cpp and .h files for his new class, the workflow required would be as follows.
- Close the VS solution
- Right-click the .uproject file and Generate Visual Studio project files.
- Once that completes, open the .sln file in VS
- Build the solution
- Hot reload should take care of the editor
After this, you should have the editor open with the new C++ class showing. The reason this is necessary is due to the Visual Studio project files and your Intermediates/Saved folders. Those files need to know that this C++ class exists. Otherwise Visual Studio will never include it in your compilation process.
I did run into a few problems while doing this and had to make multiple files writable, mainly things in the Intermediates folder. This is due to Perforce automatically making things read-only that shouldn’t be, such as the .sln file.
If this is still too much of a hassle, it may be a better idea (depending on your available upload speed) to have the person submitting these changes to also sync their binaries, intermediates, and saved folders as well as the .sln and .uproject file to avoid needing to generate and compile. You’ll still need to close the editor at this point due to the .dll being overwritten but you would be able to skip the compile.
Edit: Made some edits to the process. Turns out closing the editor isn’t necessary. I thought it was but there were other issues causing the error that was coming up at the time.
Thank you for the descriptive answer. I really appreciate it!
Based on our testing, it seems like we came across basically the same steps. It’s a little unfortunate, but at least now we know we aren’t performing any time-consuming steps that are unnecessary to allow for the propagation of c++ files in the editor.
Coming from a team that loves to commit and pull often, this workflow is very slow and cumbersome. But I suppose it’s a byproduct of many AAA engines to expect many daily repetitive processes to take a fairly long time. Or so I hear whispered around the industry. Any minute unnecessarily wasted in my book should be of serious concern to a team’s productivity. So hopefully the need to completely close the editor will be fixed in a future release by way of some kind of editor-refresh-button for the C++ classes folder.
One can hope! Anyway, thank you again.