add_viewmodel
Append a UMVVM view model context to a Widget Blueprint's MVVM authoring state, specifying its view model class, context name, and creation type.
Instructions
Append a UMVVMViewModelContext to a Widget BP's MVVM authoring state.
Returns: { widget_blueprint_name, view_model_class, context_name, creation_type, source_property_path?, global_identifier?, already_existed, view_model_count, has_mvvm_extension }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | Optional. This command is REFUSED while a Play-in-Editor session is running: it either compiles a Blueprint (the reinstancer can retain a world, and CheckForWorldGCLeaks is Fatal -- it KILLS the editor) or writes to disk (Editor.AllowSavingAssetsDuringPIE=0 makes the engine refuse the write, so it would report success without writing a byte). Stop PIE and retry instead; force=true runs it anyway, at your own risk. | |
| context_name | Yes | FName identifying this context (idempotency key) | |
| creation_type | No | Optional (default "CreateInstance"): one of "CreateInstance" | "PropertyPath" | "GlobalViewModelCollection" | "Manual" (EMVVMBlueprintViewModelContextCreationType). | |
| view_model_class | Yes | View model class: asset path (/Game/...) or /Script/<Module>.<ClassName> | |
| global_identifier | No | Optional: only used when creation_type="GlobalViewModelCollection" (required in that case). Sets FMVVMBlueprintViewModelContext::GlobalViewModelIdentifier. | |
| source_property_path | No | Optional: only used when creation_type="PropertyPath" (required in that case). Sets FMVVMBlueprintViewModelContext::ViewModelPropertyPath. | |
| widget_blueprint_name | Yes | /Game path of the Widget Blueprint asset (string) |