Download

export custom C++ class

Hello everyone,

I created my own actor class in c++ and would like to know how I can export it in another project?

Thanks!!

Just copy the code to another project. :slight_smile:

I try it but the copied class must be registered in your UE project, it’s not only copy class and add it in you project…
I tried to convert my c++ class into blueprint component to be able to migrate it, a .copy file was generated but I don’t know how to use it to import it from another project
FYI: the migration process is not for me, I would like to send “migration” file to a friend who can be able to import it

I don’t understand what you want to migrate. A blueprint, a .cpp file?

You could just make a new class in the new project and copy paste the code.
that’s so quick & easy I wouldn’t even look into another method myself :stuck_out_tongue:

I think that he has a class in C++ and a blueprint derived from that class. Then there would be a problem with exporting the files and sending them to a friend so he could import them. If I’m right, this is what needs to be done:

  1. Add the class code to the project and compile it
  2. Copy the blueprint class file directly from your content directory to another project content directory
  3. Open DefaultEngine.ini (Should be located at PROJECT_DIRECTORY\Config\DefaultEngine.ini)
  4. In the section [/Script/Engine.Engine] add:


+ActiveClassRedirects=(ObjectName=,OldClassName="YourModule.YourClassName",NewClassName="YourClassName")


  1. Start the editor - everything should work correctly

Exactly Ogniok, I try this an come back, thanks!

RESOLVED: So finally I didn’t need to export my Blueprint class, my problem was when I copy my C++ class in another project I need to replace the “XXX_API” macro in front of my class name in header file, like this I was able to generate the “.generated.h” file…

I have an Actor Component writtern in C++. Half an hour of google searching made me believe that this is the only way to export my ActorComponent to another project.
I find this to be terrible. I was convinced that there must be some option to package my code so that I can drag&drop it into another project and it will work…