/ MAYA, SCRIPTING

PyMel Development: With VSCode

Step 1: Install Visual Studio Code

Step 2: Install VSCode Plugins

Step 3: Prepare Maya

From the Installation Guide from SendToMaya:

To enable ports at startup create a file named userSetup.mel in the following folder:

  • Windows: \Documents and Settings\My Documents\maya\scripts
  • Mac OS X: ~/Library/Preferences/Autodesk/maya//scripts.
  • Linux: ~/maya//scripts. (where ~ is your home folder)

In the userSetup.mel file add the following

commandPort -n "localhost:7001" -stp "mel" -echoOutput;
commandPort -name "localhost:7002" -sourceType "python" -echoOutput;

Step 4: Test Setup

  1. Open Maya and VSCode
  2. In VSCode create a file test.py
  3. Write following lines:
import pymel.core as pm
pm.sphere()
  1. Right click anywhere “Debug in Maya” or ctrl+alt+d
  2. Check in Maya if a Sphere was created.