Maya

About

Production Management

Settings

Program Settings

Default location for program settings, including scripts:

Documents\maya\version number

File Formats

Maya Archive

File > Archive Scene to package the .MA model file with any textures linked to the materials in the scene.

Alembic

Outline for flags in AbcExport()

FBX

In exporting FBX for use in UE4, verify Smoothing Groups is enabled.

image

Animation

In the Graph Editor, select all keyframes/curves and in the first time field enter +=100 to shift all the keyframes/curves by 100 frames.

Maya Python

Settings

Startup Script

Verify the following path is added to the system environment variable PYTHONPATH. The startup script is run each time Maya starts up and is intended for commands to setup the Maya work environment. As such, it is run at a moment when dependencies on Maya functions are inaccessible while Maya is starting up.

<user's directory>\My Documents\maya\<Version>\scripts\userSetup.py

Add Path Recognition

Append the path in the startup script, userSetup.py.

import sys
sys.path.append(r'<path\to\script\dir>')

Another option in lieu of appending the path in the startup script is to set the path in the PYTHONPATH system environment variables.

Environment Variables

For use with MayaPy, apply the following environment variables. This can be applied under the project settings or the configuration for a specific Python script within a project.

PYTHONPATH

C:\Program Files\Autodesk\Maya2020\Python\Lib\site-packages\;C:\Program Files\Autodesk\Maya2020\Python\Lib\site-packages\maya

MAYA_LOCATION

C:\Program Files\Autodesk\Maya2020

PATH (required for bash to recognize mayapy)

C:\Program Files\Autodesk\Maya2020\bin

To confirm what paths are being recognized by Maya, run the following in Maya's Script Editor to list the noted paths.

import pymel.util
print '-----------------------------------Maya Python Paths START'
for path in pymel.util.getEnv("PYTHONPATH").split(';'):
	print 'Python path - %s' % path
print '-----------------------------------Maya Python Paths END\n'

Operations

Python To Shelf Tool

Process for converting Python script into Maya shelf tool

image

Note: Select all text in Python script and MMB + drag to shelf to create tool.

PyCharm

Setup PyCharm

To equip PyCharm for use with Maya, verify that the Python Interpreter is set to use the mayapy equipped by Maya.

image

Configure Maya site-packages and set as Source.

image

Maya Python Autocompletion

To access auto-completion when scripting Maya Python in PyCharm, use the latest Maya SDK and add the following folder to the Interpreter's Project Structure (Settings > Project > Project Structure) and mark as Sources. SDK can be saved anywhere on disk, so long as the path is noted in the Project Structure above.

<Path>\<to>\devkitBase\devkit\other\pymel\extras\completion\py 

Maya DevKit Downloads

External Documentation

Add the following link to Maya's Python Documentation as a path to PyCharm's External Documentation. This allows for quick access to the documentation when the maya module is accessed by clicking SHIFT + F1 on the imported module name.

Setup in PyCharm is through Settings > Tools > External Documentation and adding the link below to the module maya.

Execute Python Scripts from PyCharm in Maya

With the above outline implemented, particularly the appending of the path to the startup script, scripts generated and edited in PyCharm can be processed within Maya in its Script Editor by entering the following:

import module as mod
reload(tools)
mod.function()

Note that the intent is to import the modules defined in the script directory noted in the startup script and have quick access to functions for processing within Maya. The reload() function is to refresh the import cache and allow edits to be made in PyCharm while both Maya and PyCharm are open at the same time.

Highlight the section of script to be executed within the Maya Script Editor, right-click, and Execute to run the process.

Resources

Resources

Keyboard Shortcuts

Keyboard Shortcuts

NameShortcutNotes
Expand/collapse parent hierarchy

Shift + + next to parent object

Snap to defined interval

J

Managed via Modeling Toolkit > Scale Settings > Step Snap

Move object throughout hierarchy

MMB drag object into or out of group/hierarchy

Support Tools