Skip to content

DoubleDeez/MDFastBinding

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

MDFastBinding

A versatile and performant alternative to property bindings for designer-friendly workflows. Intended for UMG widgets but usable in any blueprint. The goal was to build a tool that allows mutating raw data into a form that can drive visuals, all within the editor, while staying performant.

Requirements

MDFastBinding now only supports Unreal 5.1 and later. See the UE-4.27-5.0 tag for older versions. Setting up MDFastBinding with this repo requires that you build your own code.

Setup

  1. Clone this repo into your Plugins folder.
  2. This step is not required for User Widgets
    Add a BindingContainer instance to your class and call the binding functions at the appropriate locations:

In your header:

// This property will be automatically populated by the Binding Editor when you setup your bindings
UPROPERTY(Instanced)
TObjectPtr<class UMDFastBindingContainer> Bindings = nullptr;

In your source file:

#include "MDFastBindingContainer.h"

// Usually in a Construct type function
Bindings->InitializeBindings(this);
// Usually in a Tick type function
Bindings->UpdateBindings(this);
// Usually in a Destroy type function
Bindings->TerminateBindings(this);
  1. Launch the editor, enable the plugin, and restart the editor if necessary.
  2. Create a blueprint that extends your class (or UserWidget)
  3. In the editor of your blueprint, you should see a "Binding Editor" button in the toolbar (may require closing and reopening your blueprint if you reparented it):

Unreal 5 Binding Icon

  1. This will open a new tab with an empty graph and an empty list on the left side. Create a new binding by click the "Add Binding" button in the bottom left and name your new binding.

Unreal 5 Binding Icon

  1. Now on the right side, you can right-click and start adding nodes to your new binding.
    Here's a screenshot binding 2 health variables to a progress bar widget's percent:

Example of binding a health bar percentage

Performance

Check out the Performance wiki page for details on how to make performant bindings.

Debugging

The binding editor integrates with the blueprint debugger to support displaying values of the binding node pins in real time and highlight values that are changing in the binding graph, based on the selected debug object in the blueprint editor. See the Debugging wiki page for more details.

GIF of the binding graph animating wires that change and watched values

Previewing in the Widget Designer

Bindings on User Widgets can be previewed in the widget designer by clicking the Enable Design-Time Bindings button in the toolbar. This is useful for previewing bindings that initialize visuals or bindings that interact with widget animations.

In this example, the square's default color is white, but it's bound to a color variable with a default of light-red:

GIF previewing design-time bindings

With design-time bindings enabled, functionality can be previewed by using CallInEditor Functions:

GIF previewing a CallInEditor function working with design-time bindings

About

A versatile and performant alternative to property bindings for designer-friendly workflows in Unreal Engine 5.1+

Topics

Resources

License

Stars

Watchers

Forks

Languages