Skip to content

Commit 7b95999

Browse files
generalize icon logic
1 parent eb0c413 commit 7b95999

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

flowpipe_editor/flowpipe_editor_widget.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,10 @@ def _add_node(self, fp_node, point):
119119

120120
# set icon based on interpreter
121121
if interpreter:
122-
if interpreter == "houdini":
123-
qt_node.set_icon(str(Path(BASE_PATH, "icons", "houdini.png")))
124-
elif interpreter == "nuke":
125-
qt_node.set_icon(str(Path(BASE_PATH, "icons", "nuke.png")))
126-
elif interpreter == "mari":
127-
qt_node.set_icon(str(Path(BASE_PATH, "icons", "mari.png")))
128-
elif interpreter == "maya":
129-
qt_node.set_icon(str(Path(BASE_PATH, "icons", "maya.png")))
130-
else:
122+
icon_path = Path(BASE_PATH, "icons", f"{interpreter}.png")
123+
if icon_path.exists():
124+
qt_node.set_icon(str(icon_path))
125+
elif interpreter:
131126
qt_node.set_icon(str(Path(BASE_PATH, "icons", "python.png")))
132127
else:
133128
qt_node.set_icon(str(Path(BASE_PATH, "icons", "python.png")))

0 commit comments

Comments
 (0)