Hello, I’m trying to make an EditorUtilityWidget where if I press a button, it changes certain default values of a blueprint.
Is there a way to achieve this (possibly w/o c++)?
Hello, I’m trying to make an EditorUtilityWidget where if I press a button, it changes certain default values of a blueprint.
Is there a way to achieve this (possibly w/o c++)?
The only semi-BP solution I remember is using the SetEditorProperty on the ClassDefaultObject (which I exposed from C++), but as far as I remember, this editor utility function was only added in 4.26.

An alternative through python. You can run python script through blueprints.
import unreal
bp_object = unreal.EditorAssetLibrary.load_blueprint_class('/game/BP_Modif_Default')
bp_default_oject = unreal.get_default_object(bp_object)
bp_default_oject.set_editor_property("age",21)
This seems to be the solution, yet I can’t test 'em since my project is at .24 
Might have to consider migrating, thanks a lot!
Thank you for the suggestion, but I am looking for the in-EditorUtilityWidget availability as of now.
Thanks! It worked! Exposing class defaults via C++ was a must.
I know it’s an old thread, but is there a way to set default values of actor components’ variables? It just doesn’t seem we have access to components through default object, right?
I’m trying to figure this out, but no dice yet.
A simple “this isn’t possible” would do
Leaving info here for people who will come after me
Easiest Way it to expose some minor C++ functions that i could not find in BP:
Expose using BPFL
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "Engine/SCS_Node.h"
#include "Engine/SimpleConstructionScript.h"
#include "GridEditing_Statics.generated.h"
/**
*
*/
UCLASS()
class PROJECT_API UEditorHelper_Statics : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
UFUNCTION(BlueprintCallable)
static UObject* GetClassDefaultObject(TSubclassOf<UObject> InClass)
{
if (InClass)
{
return InClass->GetDefaultObject<UObject>();
}
return nullptr;
}
UFUNCTION(BlueprintCallable)
static TArray<UActorComponent*> GetComponentTemplatesFromActorClass(TSubclassOf<AActor> InActorClass, TSubclassOf<UActorComponent> InComponentClass)
{
if (InActorClass && InComponentClass)
{
if (UBlueprintGeneratedClass* ActorBlueprintGeneratedClass = Cast<UBlueprintGeneratedClass>(InActorClass))
{
if (auto ConstructionScript = ActorBlueprintGeneratedClass->SimpleConstructionScript)
{
TArray<UActorComponent*> ResultComp;
for (const USCS_Node* const Node : ConstructionScript->GetAllNodes())
{
auto ComponentTemplat = Node->GetActualComponentTemplate(ActorBlueprintGeneratedClass);
if (ComponentTemplat && ComponentTemplat->GetClass() == InComponentClass)
{
ResultComp.Add(ComponentTemplat);
}
}
return ResultComp;
}
}
}
return TArray<UActorComponent*>();
}
};
To Edit Actor CDO with Bluetility
To Edit Component Templates with Bluetility