Chapter 1
The Maya Command Engine and User Interface
Author
Ryan Trowbridge
Project
Input simple commands using the Script Editor
Example Files
None
Synopsis
This chapter briefly describes the basic low-level structure of Maya by focusing on its Command Engine. Following this description, we examine Maya’s different programming interfaces and the tasks for which each is best suited. We then introduce the different tools in the Maya GUI for programming with Python. Finally, we demonstrate some basic commands and indicate where readers can find more information about Maya commands and the Python language.
Resources
Python Documentation
Maya Python Command Documentation
Other Notes
The string examples listed on p. 20 in the body may be confusing since they do not appear in the code type face. Specifically, all of the examples using triple quotation marks are intended to be read as three pairs of double quotation marks, rather than six pairs of single quotation marks. Refer to Table 1.1 for clarification.
Errata for the First Edition
None
Hey Ryan,
I’m currently working through the first chapter but ran into a minor problem: When trying to execute this code:
maya.cmds.polyCube(‘pCube1’, query=True, width=True);
I don’t get any results. I do have pCube1 in my scene and it doesn’t give me any errors either. Am I doing something wrong or is there a specific setting in Maya I need to set?
Thanks ahead and really enjoying the book so far!
Frieder
Frieder said this on September 16, 2012 at 7:32 pm |
And – kinda dumb to reply to myself – on Chad Vernon’s blog it says (http://www.chadvernon.com/blog/resources/python-scripting-for-maya-artists/python-in-maya/)
print cmds.polySphere(x[1], query=True, radius=True)
(or in the book example it would be: print maya.cmds.polyCube(‘pCube1′, query=True, width=True);)
with the print I’m getting a feedback, which I guess is good enough for now.
Frieder said this on September 16, 2012 at 7:37 pm |
Hello,
I was following chapter 1. when input maya.cmds.polysphere(); a error pop up saying “Error: AttributeError: ‘module’ object has no attribute ‘polysphere’ #” Can you guys help me out here? much appreciated.
max said this on April 12, 2013 at 6:26 pm |
It should be “maya.cmds.polySphere()”
david said this on March 2, 2014 at 12:36 am |
nvm…S needs to be capitalized. Sorry about that~
max said this on April 12, 2013 at 6:28 pm |