maya Basic Maya Commands Explained Basic maya command syntax


Maya commands come in a very small range of forms. Recognizing the form that a command takes is useful for working with new commands.

Simple commands

The most basic form is simply <command>(<object>) where is the function you're calling and is the string name of an object you are working with:


Many commands can accept multiple targets. You can pass these individually or as iterables (lists, tuples)"top", "side")
  cameras = ['top', 'side']

You can Python's star *args to pass an iterable object like a generator to a command:*a_generator_function())

A lot of commands take flags which control their behavior. for example'mesh')

will return a list of meshes, and'nurbsCurve')

returns a list of nurbs curves.

Commands which take flag can use the Python **kwargs syntax, allowing you to create dictionary of flag-value pairs and pass that to the command:

   options = {type: 'mesh'}**options)

is the same as'mesh')

This can be very useful when assembling a command from a list of options supplied by a user or by script logic