Blueprint event on property changed?

I’m looking for a way to make data validation for values input to properties in the Details window in the editor. I’m a designer so I’m not good with code. Recently I saw some examples of how many things can be done in Blueprints via Create → Editor Utilities.

Does anyone have experience with that? Basically I want to get an event when the property changes value and then react if the new value is not allowed. This should happen when editting Actors in the editor, not ingame.

I’ve been trying with Editor Utility Blueprints and Editor Utility Widgets but could not find any way to do it. I found ‘Bind Event to On Property Changed’ but it requires PropertyViewBase as target and I don’t know how to get that.

Edit:
I found that in EditorUtilityWidget you can add SinglePropertyView and then bind it using OnPropertyChanged. But In my case I want it to react to change to Transform’s Rotation. So I cannot create a new property but connect to an existing one. Don’t know how to do that…

I’m still fighting with this. Does anyone know how to connect default editor’s Details panel to ‘Bind Event to On Property Changed’?

obraz

I don’t know how to get proper Target for that node…

Hi!
Here is something that can help

You can call OnPropertyChanged from both. But I’ve seen that variables like Vector, Rotator or Transform aren’t supported in SinglePropertyView. So you can do it with the DetailsView or make 3 separate floats with SinglePropertyView, one for each axis of the rotation.
Also, you may need to connect your object data to the widget variables.

I don’t wake to make a new window/widget. I’d like to connect to the existing details window.

In that case, you may have to make your own OnPropertyChanged.
For example:

This is an EditorUtilityWidget

Yeah, I’ve been doing a similar thing - I store and check change in rotation in the Construction Script. It just feels hacky and not optimal. I hoped there was a better way. But thanks your idea will work too.

I was able to execute stuff when the properties get changed like the image below (listening to the Event Pre Construct).

I decided to create a reusable button with the ability to change its text manually in the editor of the WidgetBlueprint using it. So that I can have multiple instances of the same button with different texts.

But how are you connecting to a specific property here? Like e.g. Rotation? I don’t see that in your screenshots…

If I got it correctly, the Event Pre Construct will get executed every time a modification is done in any element of this whole Widget.
That is why I did not need to connect my text field.

1 Like