上篇博客写到创建自定义菜单但是当我把Substance Designer的关于python的环境变量添加到程序当中的时候发现创建了两个菜单并且两个菜单是相同的。于是开始找原因,不过在翻帮助文档的时候突然发现一个比较有用的信息,也就是把菜单当作插件来加载以及卸载这个问题就彻底解决了。于是就有了下面的codes:
# -*- encoding: utf-8 -*-
import sd
from PySide2 import QtWidgets
# Get the application and the UI Manager.
app = sd.getContext().getSDApplication()
uiMgr = app.getQtForPythonUIMgr(