mrmcdog23
(mrmcdog23)
August 10, 2025, 6:38pm
1
Hello. I’ve creating a new level sequence via C++ and it creates the uasset on disk but is not visible in the content browser. I’m in Unreal 5.5 and Visual Studio version 17.11.2. Any help as to why this is would be appreciated as I create one via python and it work fine. Thanks in advance. Joe
UPackage* Package = CreatePackage(*FString("/Game/Shots/NewLevelSequence"));
ULevelSequence* LevelSequence = NewObject<ULevelSequence>(
Package, ULevelSequence::StaticClass(), NAME_None, RF_Public | RF_Standalone);
LevelSequence->Initialize();
// get package name and file path
const FString PackageName = Package->GetName();
const FString PackageFileName = FPackageName::LongPackageNameToFilename(
PackageName, FPackageName::GetAssetPackageExtension());
// create the save args
FSavePackageArgs SaveArgs;
SaveArgs.TopLevelFlags = RF_Public | RF_Standalone;
SaveArgs.SaveFlags = SAVE_NoError;
UPackage::SavePackage(Package, nullptr, *PackageFileName, SaveArgs);
Max.Chen
(Max.Chen)
August 11, 2025, 6:21am
2
Try calling:
FAssetRegistryModule::AssetCreated(LevelSequence);
mrmcdog23
(mrmcdog23)
August 11, 2025, 8:49am
3
Hi Max. Thanks for your response. The same problem exists which is strange. I’ve added to the code to open the level sequence and I click on the show in content browser and it goes to the correct folder but it doesn’t show up.
Thanks. Joe
Max.Chen
(Max.Chen)
August 12, 2025, 4:01am
4
Sorry not quite sure why it isn’t working. Does it reappear if you save the asset and or restart the engine?
mrmcdog23
(mrmcdog23)
August 12, 2025, 1:23pm
5
No its very strange Max, if I save and restart it show in the content browser. The python version works fine.
asset_tools = ue.AssetToolsHelpers.get_asset_tools()
sequence = ue.AssetTools.create_asset(
asset_tools,
asset_name=asset_name,
package_path=package_path,
asset_class=ue.LevelSequence,
factory=ue.LevelSequenceFactoryNew()
)
Not sure if the c++ command is incorrect and should use the AssetToolsModule given in this example:
Though is seems like over kill seeing as it is all working just not showing up in the browser.
Thanks.
mrmcdog23
(mrmcdog23)
August 13, 2025, 12:43pm
6
I have noticed when it does the asset register it logs this:
LogContentValidation: Display: Starting to validate 0 assets
LogContentValidation: Enabled validators:
LogContentValidation: /Script/DataValidation.EditorValidator_Material
LogContentValidation: /Script/DataValidation.DirtyFilesChangelistValidator
LogContentValidation: /Script/DataValidation.EditorValidator_Localization
LogContentValidation: /Script/DataValidation.PackageFileValidator
LogContentValidation: /Script/DataValidation.WorldPartitionChangelistValidator
LogContentValidation: /Script/InputBlueprintNodes.EnhancedInputUserWidgetValidator
Is there something I need to run to register the asset other than:
FAssetRegistryModule::AssetCreated(LevelSequence);
Thanks very much. Joe
Max.Chen
(Max.Chen)
August 13, 2025, 6:35pm
7
Instead of this:
ULevelSequence* LevelSequence = NewObject<ULevelSequence>(
Package, ULevelSequence::StaticClass(), NAME_None, RF_Public | RF_Standalone);
try this:
ULevelSequence* LevelSequence = NewObject<ULevelSequence>(
Package, "NewLevelSequence", RF_Public | RF_Standalone);
mrmcdog23
(mrmcdog23)
August 14, 2025, 8:27am
8
He’s cracked it! Thanks Max that worked. Much appreciated!
1 Like