Starting With Maya API

Hi All,

I am gonna start with Maya API using Python.
Can anyone suggest me some exercises(small snippets) that i can create to get stated with the tool.

Thanks

Day Dreamer

Autodesk recently put out a set of webinars and work files specifically for that
I think this is it:
http://www.adskconsulting.com/adn/cs/api_course_webcast_archive.php

Go down till Mayay(Api)

Just remember, use the API as little as possible- stick to pymel (or maya cmds if you’re stubborn). The API is generally much more difficult to script with, and you should only use it when you don’t have a reasonable alternative.

Chad Vernon has good resources on his website (www.chadvernon.com). “Complete Maya Programming” by David Gould also offers a lot of in-depth info - you can get it on Amazon and there’s even a Kindle version. Then this: http://nccastaff.bournemouth.ac.uk/jmacey/RobTheBloke/www/ and this: Maya API Help Page - CometCartoons and of course the Maya API help and Autodesk’s forums on The Area. Most of it is C++ specific though.

Chad also put up a video tutorial series on cgcircuit.com Been meaning to check it out.

The first API script I wrote was pieced together mostly using the API docs. I learned quite a bit by looking at the sample scripts provided in the API (each page for a class has example scripts listed on it that use that class) and seeing how they used the functions I was interested in. It was still slow going, but the more examples I saw, the better I (hopefully) understood how to use it. And a lot of google searching to look for solutions or extra info on problems I was having (like how to us MScriptUtil and how to build different arrays).

The docs actually have quite a bit of info in them; I would also recommend reading through the API guide. Basically just read as much as info and code as you can and ask questions.

For asking questions you should join the python_inside_maya google group. It can be a good place to pick up tidbits and ask questions (Redirecting to Google Groups). They have no guides or walkthroughs or anything but I’ve picked up a number of tricks by reading other people’s API questions and the few I’ve asked myself.

And post about stuff you learn along the way! The more info out there to help people getting started (since they will undoubtedly run into the same problems) the better.