Add Edit this widget button to your editor widgets!

You can shave off a few seconds of finding a widget asset by directly providing “Edit this widget” button to your widgets. Clicking the button opens the asset editor with that given widget:

Firstly, we will create a C++ blueprint function that will open our widget with editor:

The magic is hidden in “WidgetCreatedBy”, which holds a reference to the asset responsible for “generating” our editor widget window.

You need to add modules “UMG”, “UMGEditor”, “EditorScriptingUtilities”, “UnrealEd” so that the code can be compiled.

Secondly, we will call the function on click event of a button:

And that’s it! You have a button that opens asset editor for a widget where button is added to!