How to save an editor created asset in C++?

I want to modify a UPaperTileMap asset passed by reference and then save it. This asset is already created using the editor.



void ModifyAndSave(UPaperTileMap* tm) {

     // modify it
     // tm->AddNewLayer( blalblalba..)


     // Now, how to save it??



}

I searched the UE source… but don’t know exactly where and how it saves it.
Thank you!

Make it a UPROPERTY()? Then it should save in the map.

Mmmm? I want to MODIFY and SAVE an asset in runtime. I think UPROPERTY has nothing to do with that…

Oh yeah. I misread the question. :frowning:

Package->Save(…)

1 Like