Can I modify the C++ file that have been used to make a blueprint?

Hello,

I created a C++ files (.cpp and .h) in Visual Studio and then I made a blueprint from them. But how to do to edit the .cpp file in VS again? I can only open the .h file from the Unreal Editor to edit. Where’s my original .cpp file? And how to open the blueprint to edit?

You have to create your blueprints from your C++ Class. And all blueprints will earn your C++ updates. I invite you to make the starter tutorials, they are very usefull.

Thank you for your answer, but I still don’t understand how to edit the .cpp file when a blueprint from this class was made. I don’t see the .cpp and .h files in Visual Studio to edit it. I can only open the .h file in Visual Studio from Unreal Editor.

To better understand for you:

1/ I created MyActor.cpp and MyActor.h in VS

2/ I made a blueprint MyActorBP from these C++ files

3/ All works great

4/ I wish to edit MyActor.cpp to for example add something to the code, but I can’t find the way to open the file

5/ I can open only MyActor.h in VS and edit it

I have just found the MyActorBP to edit it. I simple named it different and forgot :). But I still don’t know how to find the .cpp file to edit it.

I can find the option to open and edit in VS the .h file, but I can’t see a way to do the same with the .cpp file. I can open only the blueprint. Isn’t possible to edit the .cpp file when the blueprint for the class has been made? No way to come back to the .cpp source? And what if I change the h. file and add for example a property or function?

use the solution browser in VS as you would in a native project . it’s usually hidden under the team browser on the right frame. it works like the windows Explorer

I don’t understand. Could you write clearer?

After opening your project in VS (for example by editing the C++ class from the UEditor window), click on View->Solution Explorer (or press Ctrl+Alt+L). All the cpp and h files will show up in it like they would in the windows explorer, so it’s easy to open them. See the attached screenshot.

Note that you have to close the UEditor, then rebuild and run the project from VS - which reopens the editor - if you change anything important.

Thank you, alpaka. I know that, but the problem was that I didn’t see the file .cpp before in VS. Now, I see both (.h and .cpp. I noticed that VS behaved very strange with UE4. The .h file can be opened from the Unreal Editor. The .cpp can be opened from the Unreal Editor or only from the VS?

I don’t think the Editor provides functionality to directly open the cpp file, but navigating to it from the header is pretty easy. If any function is already implemented, just put the cursor on it and press F12 on your keyboard. If not, open it in the solution explorer. If the cpp file doesn’t show up in the solution explorer, something is definitely wrong, though.

Than you very much, alpaka. That’s what I wanted to know.