Share

Maya Python API 1.0 vs Maya Python API 2.0

Maya Python API 1.0 is generated from the Maya C++ API. It is more comprehensive than Maya Python API 2.0, but less Pythonic than API 2.0. If you are already familiar with Python, API 1.0 may be less intuitive to use than API 2.0.

Maya Python API 1.0 does not include Viewport 2.0 interfaces. The Viewport 2.0 Python API is only availabe in API 2.0.

Maya Python API 2.0 is more Pythonic than Maya Python API 1.0. Its structure will be more familiar to Python programmers, and will be more intuitive to use as a result.

Maya Python API 2.0 is not as comprehensive as API 1.0, but it has several advantages over API 1.0:

  • Array types are full Python sequences
  • Methods which take Maya array parameters will, with few exceptions, take native Python sequences, such as arrays and tuples
  • Methods pass their outputs through return values rather than through their parameter lists
  • Multiple values are returned as tuples or lists, eliminating the need for MScriptUtil
  • Many object attributes are accessed directly instead of through setters and getters
  • More types of exceptions
  • Faster and more efficient
  • Includes Viewport 2.0 API

You can use both Maya Python API 1.0 and Maya Python API 2.0 together. However, you cannot pass an API 1.0 object to an API 2.0 method and vice versa.

Was this information helpful?