Download

Saving objects created in the edifor using C++

I have an editor blueprint that I’m using to access C++ and place a bunch of InstancedStaticMeshComponents and adding instances to them, but they’re not saved when I reload the editor.

How do you get them to save?

While in Editor, asset should have “RF_Transactional” flag:
https://api.unrealengine.com/INT/API…ags/index.html

To make changes to the Blueprint you make changes to the CDO stored in the package, GetMutableDefault<T>() is useful:
https://api.unrealengine.com/INT/API…t/3/index.html

Before making any changes through code you have to call Modify():

Saving then should be handled automatically by Unreal Editor.

My issue was that I was making a TArray referencing the components in the function then letting it go, instead of making it a class property. Fixed that and it became fine.

Oh if the array is in function scope memory is destroyed when function is done ^^