Hello! I’m trying to set up a widget using a view model contract, and I’m running into issues previewing the data at editor time. In particular, whenever I try to set or query data on the view model during editor-time I get warnings that it’s null.
I first set my Viewmodel creation type to Create Instance
with Create Setter Function
, then I tried to create an instance of my view model in my widget in my preconstruct before I use it, but I just got more warnings saying that the object is null when I create it.
Next I tried unchecking Create Setter Function
, then binding on construct to load the preview data when it’s changed. But when I loaded the preview using the preview button (which I only figured out how to enable thanks to this answer) and changed the preview data, I got the same warnings that the view model was null.
I know it must be possible to use the view model during editor time because the demo video for this feature does this! He even exclaims “no need to PIE!” So what am I doing wrong? How do I preview a widget with a view model without PIE?