MVVM
Use AgentKit to read the viewmodels and bindings on a Widget Blueprint and change how an existing viewmodel is created. Unreal’s MVVM tools handle creating viewmodels, properties, and bindings.
Inspect the viewmodels in
WBP_InventoryHeader. If its existingInventoryViewModelsupportsCreateInstance, switch to that creation mode. Tell me which bindings are configured.
- The agent reads the current viewmodel, creation mode, and bindings with
describe_mvvm. - It uses
set_viewmodel_contextto requestCreateInstance. AgentKit checks whether the engine allows that mode and compiles and saves the Widget Blueprint if the change succeeds. - The agent reads the configuration again and reports the resulting creation mode and bindings.
On success, the widget creates its own viewmodel instance and keeps its existing bindings. Review the creation mode in the editor’s Viewmodels panel. Captures use design-time defaults for runtime data.
© Yoshu.dev