Unreal Editor Painter


This project shows how to use the UnrealPainter in the editor.
It uses the Unreal Scriptable Tools and the Unreal Editor Utility Widgets.
This is just a demo and only shows the possibilities of UnrealPainter.
The idea was to see how far you can get with “Unreal Standards”, i.e. without creating your own C++ classes.
You find the Project here: https://github.com/DimaChaichan/UnrealEditorPainter


How it works

A blueprint with the name “BP_PaintMesh” is used for painting. It has a static mesh and a “BP_PaintSystem” component.
The PaintSystem uses only one map “BaseColor” and only one paint event is used. We use the PaintSystem in Dynamic mode.

Unreal Scriptable Tools

The scriptable tool works as follows: when the tool is started, it checks whether the first selected actor is a static mesh.
If it is, it is hidden and a BP_PaintMesh is spawned in its place. When the tool closes, BP_PaintMesh is destroyed and the original mesh is displayed.

Now you can simply call up the Paint method for drag events and you are ready to paint.

The position of the brush is controlled via the hover.

I use an event disapater from the Property Blueprint for the buttons.

Unreal Editor Utility Widgets

I wanted to see if it is possible to display the Painter in an Unreal Editor utility widget. Since there is no viewport widget, I didn’t know what to do at first.
Then I found this tutorial: https://www.youtube.com/watch?v=pJYIwprcIpI

Now I was able to create a vieport but this viewport widget is really limited in what it can do and there is no documentation at all.
To be able to build the painter at all I have to be able to convert screen to world coordinates.
The DeprojectScreentoWorld node doesn’t work here because the viewport doesn’t have a player.
So I have to see what the C++ code looks like and rebuild it in Blueprint. You can’t access the camera in the viewport, so you have to build the transform values yourself.
It works to some extent!

Another problem with the viewport is that reflaction cubes do not work. You have to build the entire camera control yourself. There is a direction light directly, but you can’t address it.

I have to say that I think it’s a real shame that you can’t find anything about this viewport. Because you could do so much with this viewport. Unfortunately, it’s just not usable at the moment. It was nice to gain experience with it and I hope that Unreal will expand this widget at some point.

Of course it is possible that I have simply used it incorrectly. Without documentation you just have to improvise.