How to add a viewport to custom editor window?
I am currently working on creating a plugin for unreal engine. Right now i have the editor window that is created with the plugin but have no idea of where to start regarding adding functionally and a view port to the window. I have looked at extending the editor video as well as other documentation but most if not all of the information is vague and doesnt really explain what I need to do such as what .h and .cpp files i should include as well as functions and classes. Any help regarding the subject would be helpful.
asked Feb 05 '18 at 08:43 AM in C++ Programming
You'll need two classes derived from these:
Since you already have an editor window, you probably have tabs already in place. Slate widgets would go in these tabs, one of which would be your 3D viewport. So, you'll need to first create a slate widget for your 3D viewport by deriving from SEditorViewport
Override the SEditorViewport::MakeEditorViewportClient() function and provide your own "ViewportClient" implementation. You do this by subclassing from FEditorViewportClient
There is also a class called FPreviewScene. You can create this in the SEditorViewport::Construct function. This is an easy way to manage the actors in your preview scene (it will have its own world)
Search SEditorViewport and FEditorViewportClient in the engine's code from github for examples https://github.com/EpicGames/UnrealEngine
answered Feb 05 '18 at 09:04 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here