How to initialise a view model in a C++ Widget class ?

Hello there,

I’m working on integrating UMGViewModel into my project and I’m trying to figure out how to initialize a view model in a C++ widget class instead of initializing it in the view model window in the BP widget.

I’ve already created a C++ view model class that I can add to the BP in the editor and bind properly, but I can’t find a way to initialize it directly in C++, maybe like internal widgets with the BindWidget meta or something.

Does anyone know how to do this?

Thanks for your help!