Maya

About

Applications

HoudiniUnreal EngineUnity 3DNukeMayaBlenderZBrushPythonMixed RealityMachine LearningGraphic DesignExtras
About

Site created with Notion, Super & Cluster

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()

alembic/alembic

Alembic is an open framework for storing and sharing scene data that includes a C++ library, a file format, and client plugins and applications. - alembic/alembic

alembic/alembic

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.

Python in Maya

Python scripting can be used for many tasks in Maya, from running simple commands to developing plug-ins, and several different Maya-related libraries are available targeting different tasks. The following is a brief overview of the Python libraries shipped with Maya: maya.cmds This is a Python wrapper for MEL commands, and can be used in place of MEL.

Python in Maya

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
Python in Maya

Python scripting can be used for many tasks in Maya, from running simple commands to developing plug-ins, and several different Maya-related libraries are available targeting different tasks. The following is a brief overview of the Python libraries shipped with Maya: maya.cmds This is a Python wrapper for MEL commands, and can be used in place of MEL.

Python in Maya

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

Maya Platform Technologies | Autodesk Developer Network

Autodesk Maya provides a rich and powerful API that can be used to automate repetitive tasks, and to extend the core functionality of Maya.

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.

Help

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

Name
Shortcut
Notes
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

Support Tools

On This Page

  • Production Management
  • Settings
  • Program Settings
  • File Formats
  • Maya Archive
  • Alembic
  • FBX
  • Animation
  • Maya Python
  • Settings
  • Startup Script
  • Add Path Recognition
  • Environment Variables
  • Operations
  • Python To Shelf Tool
  • PyCharm
  • Setup PyCharm
  • Maya Python Autocompletion
  • Maya DevKit Downloads
  • External Documentation
  • Execute Python Scripts from PyCharm in Maya
  • Resources
  • Keyboard Shortcuts
  • Support Tools