OnPropertyChanged or similiar, does it exist?

Is there a way to detect when changes have been made to an object in the editor?

Like a virtual function named “OnPropertyChanged” or something like that. I’m sure it exists, just can’t find it.

Edit: So I happened to find something called “PostEditChangeProperty” - would that be the correct one to use? Guess I’ll try when I get home.

Hi Stefan,

Yeah, PostEditPropertyChanged is the correct method to use on your own object. Here’s an example:


#if WITH_EDITOR
void UPaperTileLayer::PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent)
{
	FName PropertyName = (PropertyChangedEvent.Property != NULL) ? PropertyChangedEvent.Property->GetFName() : NAME_None;

	if ((PropertyName == GET_MEMBER_NAME_CHECKED(UPaperTileLayer, LayerWidth)) || (PropertyName == GET_MEMBER_NAME_CHECKED(UPaperTileLayer, LayerHeight)))
	{
		Do some stuff
	}
}
#endif

Cheers,
Michael Noland

1 Like