Setting up in Maya (PySide2 for 2017+)

A quick guide on how to get set up in Maya and confirm it can be found by creating a dummy UI window.

Go to the Github repo here:

Download the repo as a Zip:

Click ‘Clone or download’ > ‘Download ZIP’

Once downloaded, extract the file, open it up and find the file.

Navigate to your Maya scrips directory (On Mac OSX this will be ‘/User/Library/Preferences/Autodesk/maya/<version>/scripts’)

Drag and drop / Copy and paste the file here.

Test it in Maya

Open up Maya, and open the script editor. Type:

import Qt
print Qt

And run the code using the double blue arrows:

Use this icon the run code in Maya

You’ll see in the output that the Qt module has been loaded:

The output confirms that the module has been found

Let’s expand on this and get a UI window to appear, update the script in Maya:

import Qt
print Qt

win = Qt.QtWidgets.QDialog()

We are creating a new window UI element, once again click on the blue arrows to run this code:

A dialog window

All done! We have downloaded and set up our module and have used it to display a window.

Using Maya 2017 and above?

If you are using a newer version of Maya you will want to use the PySide2 module which comes imcluded in newer versions of Maya.

The above code will be modified slightly to call the PySide2 module rather than Qt, but the outcome is still the same:

import PySide2
print PySide2

win = PySide2.QtWidgets.QDialog()