UMG polling MVVM binding every frame instead of only when the delegate fires

Hello all! :slight_smile:

I am using the MVVM plugin to drive changes to and from my UI. The MVVM plugin uses UPROPERTYs with the FieldNotify tag to only notify the binding, when the property changes.

Unfortunately, this is not what is happening at all with some UMG Widget properties bound to the View Model. e.g. Visibility. Instead, the property on the ViewModel gets polled every frame.

I have also noticed something peculiar with the UMG properties shown in the View Binding editor window. The arrow icons are different, probably having a distinct meaning which isn’t mentioned in the official documentation. Any UMG property which has an arrow icon with the vertical bar in this window works properly with MVVM and does not poll the View Model property every frame. Other properties have the constant polling issue.

Does anyone have an idea why this is happening or even, which source files one could look into to debug this bug?

Best Regards

After hours of debugging and going through the Engine code for UMG and the MVVM plugin, I figured out the problem. I had the Construct method of the UserWidget class being called over and over again, making the binding appear to be polling, when it wasn’t. This was happening because I forgot to set my boolean gate to true in the DrawHUD method of my HUD class, after constructing my widgets once.

I wish the official documentation had this somewhere, but here is an article I found to understand the basic lifecycle of UMG widgets.

[UE4] UMG life cycle - Programmer All

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.