Skip to content

Commit ab6f9d4

Browse files
author
Bryan
committed
nor node
1 parent 136abbc commit ab6f9d4

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

node_editor/gui/node_list.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ def __init__(self, parent=None):
99
self.addItem("Output")
1010
self.addItem("And")
1111
self.addItem("Not")
12+
self.addItem("Nor")
1213

1314
self.setDragEnabled(True) # enable dragging
1415

node_editor/gui/node_widget.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ def create_not():
4949
return node
5050

5151

52+
def create_nor():
53+
node = Node()
54+
node.title = "NOR"
55+
node.type_text = "built-in"
56+
node.add_port(name="input", is_output=False)
57+
node.add_port(name="output", is_output=True)
58+
node.build()
59+
return node
60+
61+
5262
class NodeScene(QtWidgets.QGraphicsScene):
5363
def dragEnterEvent(self, e):
5464
e.acceptProposedAction()
@@ -97,6 +107,8 @@ def create_node(self, name):
97107
node = create_and()
98108
elif name == "Not":
99109
node = create_not()
110+
elif name == "Nor":
111+
node = create_nor()
100112

101113
self.scene.addItem(node)
102114

0 commit comments

Comments
 (0)