-
Notifications
You must be signed in to change notification settings - Fork 7
Home
The MDViewModel plugin is an Unreal-ified implementation of the Model-View-ViewModel pattern supporting UMG Widgets and Actor Blueprints as Views.
- Bind UMG Widgets and Actor Blueprints to View Models
- Caches View Model objects for the life time of their model data source
- Automatically fetch/create View Models and bind them to Views based on tuning set in each View
- Generates Blueprint events automatically for binding view model data to Blueprint logic, facilitating event-based updates to your Views
- Custom editor extensions to improve view model workflows and debugging
- FieldNotify properties and functions on view models are automatically exposed as Blueprint Events
- Integrates with the Blueprint Editor Debugger to display the values of properties on view models that are set on the instance being debugged
- Create View Models as C++ classes or Blueprints
MDViewModel supports C++ projects using Unreal Engine 5.1 or greater. Features may vary depending on the engine version.
This plugin is written with the assumption that you follow certain methodologies when using view models.
- Visual properties and logic are set within the View's Blueprint.
- A view never communicates directly with the model object.
- Everything goes through view models.
- Model objects (gameplay objects, online backend systems, etc) are not aware of view models.
- Instead view models reach into the external systems to grab the data they need, bind delegates and send out commands.
- A view model will only represent a single model object (a view model can hold sub-view models though) and will only ever represent that 1 object.
- Each model object should have a unique view model.
- For a view to display data from a different object, it should bind to a that object's view model.
MDViewModel does what it can to streamline the most common workflows and patterns for binding to model data, but some more complex patterns will require more manual work.
While this is how MDViewModel is intended to be used, it's powerful enough to be used (or abused) for other patterns as well.
Check out the Getting Started page to get set up and learn how to create and bind to a view model.