Welcome to this Introduction to Python Programming for Maya.
In this course, you will go from zero to a comfortable level of programming knowledge that will allow you to create your own tools, automate tedious parts of your workflow and help yourself and your team work a lot more efficiently.
The course will be more relatable to animators, as well as layout and rigging artists, mainly due to the nature of the projects, however, anyone working in Maya could benefit from the lectures if they are looking to learn Python programming.
Welcome to this Introduction to Python Programming for Maya.
In this course, you will go from zero to a comfortable level of programming knowledge that will allow you to create your own tools, automate tedious parts of your workflow and help yourself and your team work a lot more efficiently.
The course will be more relatable to animators, as well as layout and rigging artists, mainly due to the nature of the projects, however, anyone working in Maya could benefit from the lectures if they are looking to learn Python programming.
Whether you're just looking to improve your daily work or considering switching to a technical role, I'm sure this course will bring you a step closer to your goal.
What is covered?
Foundational programming concepts in Python: Loops, if statements, functions, lists, dictionaries, etc.
Fundamental techniques and best practices: Even if it's a beginners course you will learn some best practices that professional TDs and developers use.
Maya cmds library: The skills you'll acquire are broad programming skills, but the projects use the cmds library a lot since the tools being created are for Maya.
Production tools: You will finish the course with actual tools that you can use in your work.
UIs: You will learn how to create UIs using the built-in libraries in Maya.
Who is this course for?
Maya artists: This course will NOT teach you how to use Maya, you might learn some new Maya tricks, but it is assumed that you have some basic knowledge of Maya (although you do not need to be advanced at all).
Complete beginners or people with some basic knowledge of Python.
Programmers looking to become familiar with Python for Maya. The contents are geared towards beginners, but the projects might help someone become familiar with Maya and its libraries.
Best way to approach the course:
Follow the projects in order: The projects are designed to introduce new concepts naturally as they are needed, from the most basic to more complex, and each project will reuse previous knowledge.
Deep Dives: The deep dives give you a break from the project to delve deeper into a specific topic. They are placed after a concept has been introduced, you might want to watch them immediately after learning the concept but you can also treat them as a reference library to go back to in the future.
Source Code: Keep a look out for the resources in each lecture, you will have be able to download the files with the source code for a portion of the project.
Video Timestamps: Unfortunately this platform doesn't offer timestamps on videos but you will be able to download text files (in resources) with time codes for important points in the lecture.
Quizzes and Exercises: You will find quizzes and coding exercises after some lectures, these are optional, but a great way to practice.
Brief introduction to the script editor in Maya.
Learn about variables, strings and create a program that displays a message in Maya's viewport.
Learn how to import libraries in Python.
A look at what your tool will look like.
Before we start coding let's do a breakdown of the steps we need to follow/automate to create our prop rig, and learn how to get as much help from Maya as possible.
We convert the MEL commands we saw in the previous lecture to Python and create the first version of the tool.
We improve the look of the circle control, look at Maya's documentation and encounter our first bug!
Learn ways to get help with Maya and Python functions as well as how to navigate Maya's Python documentation.
Dynamically get the name of the new node/object created by Maya and start learning about lists.
Make the tool a lot more flexible and control the flow of your code by using "if" statements. We will also learn about indentation and comments.
A more in-depth explanation and examples of "if" statements and booleans.
Learn the power of functions and how to create them.
We'll also introduce string concatenation and talk about float division.
Take what we learned about functions and simply turn our tool into one.
We will be using PyCharm for the rest of the course; however, it is not mandatory. If you are already familiar with PyCharm, or you prefer to use a different IDE/text editor, you can skip this lecture.
And now to finish your first project, learn how to create a module and turn your code into one!
Functions are an essential concept to master, let's dive a bit deeper into what they are, how they work and how to use them to our advantage.
Answer a few questions about functions.
Walkthrough of the tool, setup of the scene we'll be using to test and breakdown of what the tool will be doing under the hood.
You can use any rig you want but if you'd like to use Morpheus you can find the files and download link in the resources.
Learn how to work with namespaces and get more familiar with lists and strings.
Get the current selection from the scene and learn about "for" loops.
Further explanation of how "for" loops work. There will also be a deep dive on this topic later on.
Get the attributes (and their values) from the nodes we selected, these are the attributes we will be transferring.
In this lecture you will get more familiar with strings, lists and for loops.
In this lecture we'll learn how to create a mapping between attributes and their values using a Python dictionary. This is how we will store the pose in order to apply it later on.
Now that you know what a dictionary is, let's write the functionality to build the actual dictionary that we need.
In this lecture we talk more about planning your code and "blocking" a function before we write the actual code, similar to how you'd block the animation for a shot.
You know how to store poses, now it's time to apply them to the target rig.
In this lecture you'll learn more about cleaning up your code and more techniques to control the flow of it by using "and" and "or" operators.
Let's create the main function that will combine our work so far; it will take the current selection, do the necessary checks and execute the transfer.
In this lecture you'll learn what an "interpreted" language is and why that matters when coding. You will also learn about list "slicing" and how to check for potential errors to properly warn the user about them.
Learn how to design and build a simple UI inside of Maya using the cmds library.
In this lecture you'll learn how layouts work, how to organize the flow of a UI and how to connect buttons to your own functions/commands.
Now that you know how UIs work, let's create one for our tool.
In this lecture you will revisit the knowledge from the previous lecture and learn about tooltips.
Congratulations on finishing the project!
Let's do a quick recap of what we covered while creating this tool.
Let's recap some of what you already know about strings and learn more of their functionality.
In this lecture we will cover "for" and "while" loops, we will go over the most important aspects of them and learn how to control the flow of the iteration with the "continue" and "break" statements.
In this deep dive we'll cover 3 of the most important "iterable" data structures: lists, tuples and sets.
These data structures are some of the most powerful tools that Python offers you to store and manage data, each one of them has useful qualities that can be beneficial for different purposes.
You will learn how how to modify existing data, iterate over it and a how to take into account "mutability" which can be both powerful and misleading in certain situations.
Dictionaries are another powerful way to collect and manage data. What differentiates dictionaries from other data structures such as sets or lists is that dictionaries store data using key-value pairs, therefore creating a unique mapping that allows you to retrieve data very efficiently.
In this lecture you will improve your knowledge of dictionaries and learn more ways to use them effectively.
Overview of what will be covered in this project.
You will leverage the code you've already written to create a completely new tool with a more complex UI.
By creating this pose library you will learn how to save data to files, how to approach the design of a tool and organize your code to make it more reusable and scalable, all while practising the skills you've gained so far.
Create the file structure for the tool.
You will learn how to create a "package" to contain your modules as well as how to organize your code by keeping the functionality separated from the UI, you can see it as separating the front-end from the back-end; this is generally a cleaner and more scalable way to work.
In order to save and share poses we need to know how to save and read files on disk.
In this lecture you'll learn how to use "json" files to save the pose dictionary as well as how to create global variables to define values that are meant to be constant in your code.
Learn how to get a list of files from a directory on disk and how to read and load that data back into a Python object.
Design and create the UI for the pose library.
You will learn how to manage a UI that offers more user interaction and requires user input.
The last step is to bridge the gap between the functionality and the UI, for this we need to write a few UI specific functions.
As a bonus you will learn how to make Maya read code from custom locations, this will allow you to share your code more easily with other people.
OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.
Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.
Find this site helpful? Tell a friend about us.
We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.
Your purchases help us maintain our catalog and keep our servers humming without ads.
Thank you for supporting OpenCourser.