Void UEditorWidgetFunctionLibrary::StartWidget(UWidgetBlueprint* Blueprint) #include "Editor/Blutility/Classes/EditorUtilityWidgetBlueprint.h" #include "Editor/Blutility/Public/IBlutilityModule.h" #include "Runtime/Core/Public/Modules/ModuleManager.h" #include "Editor/LevelEditor/Public/LevelEditor.h" #include "Editor/UMGEditor/Public/WidgetBlueprint.h" The corresponding part in the cpp file with the implementation of the function will be like this: The important points to note here are the presence of a StartWidget static function taking as parameter a UWidgetBlueprint object. Static void StartWidget(UWidgetBlueprint* Blueprint) #include ""Ĭlass CPPEDITORWIDGET_API UEditorWidgetFunctionLibrary : public UBlueprintFunctionLibrary #include "Runtime/Engine/Classes/Kismet/BlueprintFunctionLibrary.h #include "Editor/Blutility/Classes/EditorUtilityWidget.h" The header of this class will give something like this: Actually, it can be any class, but we will only need to create a static function allowing us to start the Editor Utility Widget, so a UBlueprintFunctionLibrary is enough. Then, in this plugin, we will create a UBlueprintFunctionLibrary. add private dependencies that you statically link with here. Starting an Editor Utility Widget from C++įirst of all, this is an editor only function, so we will need to create a new editor plugin (everything is explained for this in the previous article about Editor Utility Widgets in C++).įor this plugin, we will require several dependencies, so the following section must be added to the Build.cs: But it’s also possible to start it programmatically using C++ and blueprints. In the previous articles, the only way to start the Editor Utility Widget was to perform a right-click on it and select Run Editor Utility Widget. If you are wondering how an Editor Utility Widget can start another Editor Utility Widget, this article will explain you how to do it. In this article, we will answer to a question we can have when using the Editor Utility Widgets: how can we programmatically start an Editor Utility Widget? We already covered this topic previously, so if you want to start with Editor Utility Widgets, you may want to check this article, this one and this one. It allows users to define editor widgets using the UMG designer. Editor Utility Widgets are one of the new feature of the Unreal Engine since 4.22.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |