I am trying to make a tool that allows users to make children of Custom Blueprint actors we have on our project.
It seems the Get Asset Tools >> Create Asset node is unable to properly create Blueprints.
All I end up with is “Empty Package” Type assets which don’t even really exist and cannot be saved.
In my repro steps, you can see that trying to do the same with the basic “Actor” class ends up the same way.
Is this not the right way to create Child Blueprint classes through BP Editor Utilities?
[Image Removed]
[Image Removed]
Hello [mention removed]
Thank you for reaching out.
Have you tried this approach:
[Image Removed]I’ve created an example project and attached it to this reply.
Let me know if this is helpful.
All the best,
[mention removed]
Hi [mention removed] ! Thanks for the swift reply!
On my project I don’t see this node…
I did my repro steps in a vanilla Unreal 5.5, where I do see the node. My project is still on 5.4.4 though.
Is this like a very very new node?
Also, I have just tried this in Unreal 5.5
It works well and does create the new Blueprint. But I still have some more questions:
It returns an object of “Blueprint Object Reference” type which I had never seen before. I can’t promote this “Blueprint Object Reference” type to a variable, and I cannot cast it to the class of the Blueprint child I have just created either.
So what is this Blueprint type? What can I actually do with it?
For context, what I am trying to do is to:
- Through an Editor Utility Widget, allow the user to create a new child of a parent Blueprint Class (This works now thanks to the new node)
- Use parameters that the user has set on the EUW to apply some settings on the child BP
- For example, say the Parent BP Class has a static mesh component in it, I want to go override the static mesh in the static mesh component by a user selected one
Right now, I can’t figure out how to access and edit the components of the newly created Child Blueprint.
My project will eventually move to 5.5 so we can stick to that at the moment.
Sorry about the confusion.
Hi [mention removed] !
We’ve successfully implemented the above in our editor, thanks for the support!
I do have a follow up question though.
I am now able to create the BP and apply user defined settings.
However, once this is done, I try to save the newly created asset using the Save Loaded Asset node but get the following error:
LogEditorAssetSubsystem: Error: SaveLoadedAsset failed: Asset is not registered. The Asset is not valid.
I tried a couple of things (Loading the asset beforehand, mark the file for add, look for a way to register the asset first) but they all failed. I didn’t manage to find a way to automatically save the newly created asset.
Would you have any pointers for me here?
Hello [mention removed]
To confirm, because you tagged this case as 5.5, do you need this working on 5.4 or 5.5?
All the best,
[mention removed]
Hi Rafael,
I am an engine programmer on the same project as Mathieu. Our timeline to UE 5.5 is still a while away so I was hoping if you could point me to a CL or set of CLs for this functionality in UE 5.5 so I can see about back-porting to UE 5.4
Thanks in advance,
~Patrick
Hello [mention removed]
Thank you for the clarification.
After creating the Blueprint Asset, you end up with a Blueprint Object Reference.
You need the CDO (Class Default Object) to change the Blueprint.
You can get that from the Generated Class, but AFAIK, this is not exposed to Blueprints.
For that, I recommend you create a simple Blueprint Function Library and add a static UFUNCTION that returns a UObject*:
`--------
Header
public:
UFUNCTION(BlueprintCallable)
static UObject* GetCDO(UBlueprint* Blueprint, const TSubclassOf Class);
Implementation
UObject* UMyBlueprintFunctionLibrary::GetCDO(UBlueprint* Blueprint, TSubclassOf Class)
{
if (!Blueprint || !Class)
{
return nullptr;
}
// The generated class from the Blueprint
UClass* GeneratedClass = Blueprint->GeneratedClass;
if (!GeneratedClass)
{
return nullptr;
}
// Check if the generated class is a child of the provided class
if (!GeneratedClass->IsChildOf(Class))
{
return nullptr;
}
// Return the Class Default Object (CDO)
return GeneratedClass->GetDefaultObject();
}`To use the CDO, cast it to the Parent Class, and then you can set variables:
[Image Removed]
This will reflect on the Child blueprint:
[Image Removed]
Let me know if this helps you in any way.
All the best,
[mention removed]
Hello [mention removed]
I believe the CL you are looking for is 34166134:
Add CreateBlueprintAssetWithParent editor function, this avoids the need to reparent a blueprint after creating it ... [RN] Added CreateBlueprintAssetWithParent editor function, for creating blueprint assets with a specific parent class
Let me know if this helps you in any way.
All the best,
[mention removed]
Hello [mention removed]
Thank you for tagging my reply as Best Answer.
I’m glad I was able to help you solve your issue.
I’ll close the case.
All the best,
[mention removed]
Hello [mention removed]
I was able to save the newly created asset using Save Loaded Asset, like so:
[Image Removed]I’ve also marked the changed properties Dirty:
[Image Removed]On pressing CreateChildBP I end up with a BP_Child that is saved:
[Image Removed]The changed values persisted between closing and reopening the Editor (this is a good test to check if the values were properly saved).
Let me know if this helps you in any way.
All the best,
[mention removed]