Maya

PyMel Development: With VSCode

Author Photo

Neal Burger

· 5 min read
Thumbnail

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;

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.
#maya
Author Photo

About Neal Burger

Neal Burger is a successful entrepreuner. He is the founder of Acme Inc, a bootstrapped business that builds affordable SaaS tools for local news, indie publishers, and other small businesses.