You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Change to "Create Child Blueprint Class" so that the new asset is created and set up for inline renaming in the Content Browser, instead of opening the Blueprint Editor with the default name.
#jira UE-11519 - Blueprints: RMB -> "Create Class based on this" in CB doesn't allow me to name the class [CL 2517970 by Richard TalbotWatkin in Main branch]
This commit is contained in:
committed by
epic@richtech.es
parent
0f3091b982
commit
ee38b591f9
+6
-18
@@ -11,6 +11,7 @@
|
||||
#include "ISourceControlModule.h"
|
||||
#include "MessageLog.h"
|
||||
#include "Engine/BlueprintGeneratedClass.h"
|
||||
#include "ContentBrowserModule.h"
|
||||
|
||||
#define LOCTEXT_NAMESPACE "AssetTypeActions"
|
||||
|
||||
@@ -175,26 +176,13 @@ void FAssetTypeActions_Blueprint::ExecuteNewDerivedBlueprint(TWeakObjectPtr<UBlu
|
||||
FString Name;
|
||||
FString PackageName;
|
||||
CreateUniqueAssetName(Object->GetOutermost()->GetName(), TEXT("_Child"), PackageName, Name);
|
||||
const FString PackagePath = FPackageName::GetLongPackagePath(PackageName);
|
||||
|
||||
UPackage* Package = CreatePackage(NULL, *PackageName);
|
||||
if (ensure(Package))
|
||||
{
|
||||
// Create and init a new Blueprint
|
||||
UBlueprint* NewBP = FKismetEditorUtilities::CreateBlueprint(TargetParentClass, Package, FName(*Name), BPTYPE_Normal, TargetParentBP->GetClass(), UBlueprintGeneratedClass::StaticClass());
|
||||
if (NewBP)
|
||||
{
|
||||
// Notify the asset registry
|
||||
FAssetRegistryModule::AssetCreated(NewBP);
|
||||
UBlueprintFactory* BlueprintFactory = NewObject<UBlueprintFactory>();
|
||||
BlueprintFactory->ParentClass = TargetParentClass;
|
||||
|
||||
// the editor should be opened AFTER being added to the asset
|
||||
// registry (some systems could queue off of the asset registry
|
||||
// add event, and already having that blueprint open can be odd)
|
||||
FAssetEditorManager::Get().OpenEditorForAsset(NewBP);
|
||||
|
||||
// Mark the package dirty...
|
||||
Package->MarkPackageDirty();
|
||||
}
|
||||
}
|
||||
FContentBrowserModule& ContentBrowserModule = FModuleManager::LoadModuleChecked<FContentBrowserModule>("ContentBrowser");
|
||||
ContentBrowserModule.Get().CreateNewAsset(Name, PackagePath, UBlueprint::StaticClass(), BlueprintFactory);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user