unreal.MVVMToolset¶
- class unreal.MVVMToolset¶
Bases:
ToolsetDefinitionC++ Source:
Plugin: MVVMToolset
Module: MVVMToolset
File: MVVMToolset.h
- classmethod add_view_model_property(view_model, property_name, property_type, default_value) bool¶
Add a property to an existing ViewModel
- Parameters:
- Returns:
True if property was succesfully added.
- Return type:
- classmethod add_view_model_to_widget(widget_blueprint, view_model_class) None¶
Adds a ViewModel to the WidgetBlueprint
- Parameters:
widget_blueprint (WidgetBlueprint) – WidgetBlueprint to use
- classmethod create_view_binding(widget_blueprint, source_context, source_property_path, destination_context, destination_property_path, conversion_name) Guid¶
Creates a View Binding from the SourceProperty to the Destination property. If there is a type mismatch, an existing conversion function will try to be used.
- Parameters:
widget_blueprint (WidgetBlueprint) – WidgetBlueprint to use
source_context (Object) – Source object that contains the source property. Can be the following: - UWidget: source property is from a widget in the widget blueprint’s widgettree - UClass: source property is from a widget blueprint’s ViewModel - Null: source property is from the widget blueprint
source_property_path (str) – Property to read data from. Contains a dot ‘.’ separated path to the field (path.subfield)
destination_context (Object) – Destination object that contains the destination property. Can be the following: - UWidget: destination property is from a widget in the widget blueprint’s widgettree - UClass: destination property is from a widget blueprint’s ViewModel - Null: destination property is from the widget blueprint
destination_property_path (str) – Property to write data to. Contains a dot ‘.’ separated path to the field (path.subfield)
conversion_name (Name) – Optional parameter, name of a conversion function to use if needed. If none is provided, this will be inferred.
- Returns:
Valid FGuid if the binding was created
- Return type:
- classmethod create_view_model(view_model_name, package_path, parent_class) Blueprint¶
Creates a new ViewModel asset
- Parameters:
- Returns:
newly created ViewModel blueprint.
- Return type:
- classmethod list_conversion_functions(widget_blueprint) Array[MVVMViewConversionFunctionDescription]¶
List Available Conversion functions for a WidgetBlueprint that bind a Source Property to a Destination Property
- Parameters:
widget_blueprint (WidgetBlueprint) – WidgetBlueprint to use
- Returns:
the FMVVMViewConversionFunctionDescription for available conversion functions.
- Return type:
- classmethod list_view_models(search_path) Array[type(Class)]¶
List all ViewModel under the search path
- classmethod list_widget_view_bindings(widget_blueprint) Array[MVVMBlueprintViewBinding]¶
List all view bindings on the WidgetBlueprint
- Parameters:
widget_blueprint (WidgetBlueprint) – WidgetBlueprint to use
- Returns:
List of FMVVMBlueprintViewBinding that describe each available view binding.
- Return type:
- classmethod list_widget_view_models(widget_blueprint) Array[type(Class)]¶
List all ViewModel on the WidgetBlueprint
- Parameters:
widget_blueprint (WidgetBlueprint) – WidgetBlueprint to use
- Returns:
List of ViewModel classes.
- Return type:
- classmethod remove_widget_view_binding(widget_blueprint, binding_id) bool¶
Removes View Binding on the WidgetBlueprint
- Parameters:
widget_blueprint (WidgetBlueprint) – WidgetBlueprint to use
binding_id (Guid)
- Returns:
True if binding was removed.
- Return type: