Last active
October 22, 2021 07:15
-
-
Save divecoder/8d3ab0a98cd4c57610a8cd25c453b0a3 to your computer and use it in GitHub Desktop.
How save created asset
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // save created asset | |
| UObject* Asset; | |
| //... Asset created by some kind of Factory method | |
| UPackage* Package = Asset->GetOutermost(); | |
| FString const PackageName = Package->GetName(); | |
| FString const PackageFileName = FPackageName::LongPackageNameToFilename(PackageName, FPackageName::GetAssetPackageExtension()); | |
| FEditorFileUtils::PromptForCheckoutAndSave({ Package }, false, false);// more robust while with the souce control | |
| //UPackage::SavePackage(Package, NULL, RF_Standalone, *PackageFileName, GError, nullptr, false, true, SAVE_NoError); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment