Vscode安装python
下载mayadevKit
https://www.autodesk.com/developer-network/platform-technologies/maya
settings.json 补全和解释器设置
{ "python.autoComplete.extraPaths": [ "C:/Program Files/Autodesk/Maya2018/devkit/other/pymel/extras/completion/py", ],
"python.pythonPath": "C:/Program Files/Autodesk/Maya2018/bin/mayapy.exe", }
端口开启
import maya.cmds as cmds
# Open new ports
cmds.commandPort(name=":7001", sourceType="mel", echoOutput=True)
cmds.commandPort(name=":7002", sourceType="python", echoOutput=True)
安装并【运行】mayaport
执行
Python: Shift +Alt + P
Mel: Shift +Alt + M