| static FAutoConsoleCommand | GAtomModulationLoadMixProfile (TEXT("atom.Modulation.LoadMixProfile"), TEXT("Loads modulation mix profile from the config save directory.\n" "Path - Path to Object to load\n" "Activate - (Optional) Whether or not to activate/update the mix once it is loaded (default: true)." "ProfileIndex - (Optional) Index of profile (default: 0)"), FConsoleCommandWithArgsDelegate::CreateStatic([](const TArray< FString > &Args) { if(Args.Num()< 1) { UE_LOG(LogAtomModulation, Error, TEXT("Failed to load mix profile: Object path not provided"));return;} const FString &Path=Args[0];int32 ProfileIndex=0;if(Args.Num() > 1) { ProfileIndex=FCString::Atoi(*Args[1]);} bool bActivateUpdate=true;if(Args.Num() > 2) { bActivateUpdate=FCString::ToBool(*Args[2]);} FSoftObjectPath ObjPath=Path;if(UObject *MixObj=ObjPath.TryLoad()) { if(UAtomModulationControlBusMix *Mix=Cast< UAtomModulationControlBusMix >(MixObj)) { UAtomModulationStatics::LoadMixFromProfile(Mix, Mix, bActivateUpdate, ProfileIndex);if(bActivateUpdate) { UAtomModulationStatics::UpdateMixFromObject(Mix, Mix);} return;} } UE_LOG(LogAtomModulation, Error, TEXT("Failed to load mix '%s' from profile index '%i'"), *Path, ProfileIndex);})) |
| static FAutoConsoleCommand | GAtomModulationSaveMixProfile (TEXT("atom.Modulation.SaveMixProfile"), TEXT("Saves modulation mix profile to the config save directory.\n" "Path - Path to Object\n" "ProfileIndex - (Optional) Index of profile (defaults to 0)"), FConsoleCommandWithArgsDelegate::CreateStatic([](const TArray< FString > &Args) { if(Args.Num()< 1) { UE_LOG(LogAtomModulation, Error, TEXT("Failed to save mix profile: Path not provided"));return;} const FString &Path=Args[0];int32 ProfileIndex=0;if(Args.Num() > 1) { ProfileIndex=FCString::Atoi(*Args[1]);} FSoftObjectPath ObjPath=Path;if(UObject *MixObj=ObjPath.TryLoad()) { if(UAtomModulationControlBusMix *Mix=Cast< UAtomModulationControlBusMix >(MixObj)) { UAtomModulationStatics::SaveMixToProfile(Mix, Mix, ProfileIndex);return;} } UE_LOG(LogAtomModulation, Error, TEXT("Failed to save mix '%s' to profile index '%i'"), *Path, ProfileIndex);})) |