How to create UE Blueprint with PyQt in python programming
This article mainly explains "python programming how to use PyQt to create UE blueprint", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "python programming how to use PyQt to create UE blueprint" bar!
Realization idea
1. Site deployment: we need a place where we can draw nodes! Take a closer look at the basic use of QGraphicsScene and QGraphicsView in this article. This article also uses the same method of PyQt to make a preview window (mini-map in the game).
2. Node creation: we need to customize the node, that is, what is in the box in the following figure, which is mainly related to QGraphicsItem in Qt. We can customize the node style by inheriting this class.
3. Connection: what is involved is QGraphicsLineItem in Qt. Inherit this class and customize the connection style in paint. For example, I use the Bezier curve of qt here.
The effect is as follows: nodes can be connected to each other through ports.
1. Site deployment class EditorView (QGraphicsView): def _ init__ (self, parent=None): super (EditorView, self). _ init__ (parent) self.parent = parent self.scaleFactor = 1 self.lastPos = QPointF () self.scene = EditorScene (self) self.setScene (self.scene) self.setSceneRect (- 1)