Python Scripts for Maya 2020
Short scripts that can be imported to automate actions
The purpose of this project is to make Python scripts for Autodesk Maya 2020 to automate tasks and learn the Maya Python API. Scripts were written in Python 2.7 on a PyCharm project.
Source Code: https://github.com/guitarjorge24/Maya-Python-Scripts
The scripts allow you to:
-
Automatically rename and classify objects in the Maya Outliner based on their object type
-
Generate a gear-shaped mesh with user-defined properties (e.g. number of teeth in the gear and length of the teeth)
-
Change the number of teeth on the gear mesh after it has already been generated (which requires readjusting which faces the extrusion node is applying the extrusion to).
-
MORE COMING SOON!
As a consequence of writing these scripts I learned:
-
How to use the Maya cmds (commands) library in Python
-
What the process of using scripts looks like from an end-user perspective, which helps me to understand how to make scripts more user-friendly.
-
How to attach PyCharm to Maya so debugging breakpoints can be hit on PyCharm while running scripts from Maya.
-
How to write Python DocString documentation for script functions so that end users are able to get information on how the script is used by calling help() from Maya.
-
The internal node structure of objects in Maya and the relationship between nodes (e.g. a cube primitive object is composed of a pCube transform which has a pCubeShape child which in turn has a polyCube input node and a ShadingGroup output node).
-
How to access the individual faces/edges/vertices of a mesh through Python and perform transformations on them.
-
How to change which faces are being affected by an extrusion node after the extrusion has already been performed.