Stop editor from changing property on compile

I’ve searched high and low for an answer to this to no avail. I’m creating a custom widget where I want to be able to load a predefined set of properties from a data table as a base configuration but allow editing of them as usual once loaded. I can load the properties fine but it overwrites them with what the editor thinks they should be when the blueprint is compiled. I want the load to be a one off, because if it’s done every time you can’t edit them. If I only do it once the settings are applied but then the editor overwrites the values on compile. There has to be a flag or something to indicate to the editor that the property is not dirty and shouldn’t be updated. I’ve tried putting the logic into SyncronizeProperties, PreConstruct, and PostEditChangeProperty nothing seems to work. Any guidance is greatly appreciated.

Hello! Can you be more precise and share some example?

When bLoadPreset is set to true in the editor it should go through this stuff and set the button size. Here is the output. When PostEdit is called for the second time (why twice? I don’t know) the value has been reset by the editor because it believes that is what it should be. If the load is performed every time you cannot edit the value. I need to disable the update.

Set bLoadPreset to true in editor:

LogTemp: Warning: [UMyButton::SynchronizeProperties] Button Size: X=500.000 Y=200.000
LogTemp: Warning: [UMyButton::NativePreConstruct] Button Size: X=500.000 Y=200.000
LogTemp: Warning: [UMyButton::PostEditChangeProperty] Button Size: X=500.000 Y=200.000
LogTemp: Warning: [UMyButton::PostEditChangeProperty] Button Size: X=300.000 Y=100.000

Compile in editor:

BlueprintLog: New page: Compile MenuWidget
LogUObjectHash: Compacting FUObjectHashTables data took 2.82ms
LogTemp: Warning: [UMyButton::SynchronizeProperties] Button Size: X=300.000 Y=100.000
LogTemp: Warning: [UMyButton::NativePreConstruct] Button Size: X=300.000 Y=100.000

UCLASS()
class DEBUGPRESETS_API UMyButton : public UUserWidget {
GENERATED_BODY()
virtual void NativePreConstruct() override;
virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
virtual void SynchronizeProperties() override;
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = “Configuration”)
bool bLoadPreset = false;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = “Configuration”)
FVector2D ButtonSize = FVector2D(300.0f, 100.0f);
};

void UMyButton::NativePreConstruct() {
Super::NativePreConstruct();
UE_LOG…
}

void UMyButton::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) {
Super::PostEditChangeProperty(PropertyChangedEvent);
UE_LOG…
}

void UMyButton::SynchronizeProperties() {
Super::SynchronizeProperties();
if (bLoadPreset) {
ButtonSize = FVector2D(500.0f, 200.0f);
bLoadPreset = false;
}
UE_LOG…
}

I can’t seem to comment here. Test.

WTH! Moderators won’t let me add any information!

Hi, You comment been auto moderated sorry that approve taken so long

Again, sorry for delay ^^’