Pages

Wednesday, May 31, 2017

learning python for animation td tips

Hi,

here's where i started
in this place can look at example code and post any questions
cgsociety maya programming (http://forums.cgsociety.org/forumdisplay.php?f=89)

here's another place i started
Chad Vernon's got a cool pdf to look at:
http://www.chadvernon.com/blog/resources/python-scripting-for-maya-artists/

Then here are a list of really great artist/tds
by searching github.com can see examples of their code for syntax.
Also by searching for their names in cgsociety.org can see their postings on scripting.

Hamish McKenzie (http://www.macaronikazoo.com/
) (https://github.com/bungnoid/zootoolbox)
Michael Comet (http://www.comet-cartoons.com/3ddocs/mayaAPI/index.html)
Jason Schleifer (http://jasonschleifer.com/)
David Gould (davidgould.com)
Rob Bateman (https://nccastaff.bournemouth.ac.uk/jmacey/RobTheBloke/www/)

here are some techniques i use to learn python
1. google what it is i'm looking for with 'stackoverflow' in search

python 'question' stackoverflow
ex: python open file stackoverflow

2. if doing something in maya
say wanted to create a cube

will use the python or mel script editor in Maya.
Then to search for what to type could do two things
--first create the cube using Maya ui then read out in MEL script editor what command was run to make the sphere.(make sure 'echo all commands is checked on in Maya')
--or search for create cube command in online maya command reference

google
maya cmds 'what wanted to do'
ex: maya cmds create sphere
which gives http://download.autodesk.com/us/maya/2010help/CommandsPython/polySphere.html
(examples should be on bottom of page)

These techniques should apply to any area like rigging, animation, simulation fx etc.  Basically just doing the action using Maya's ui then reading out the command that was used then retyping that command and putting it in python functions (learning about syntax, functions and classes from some of the great artists i mentioned on github) etc.
 
Hope this was helpful.

Some doodles:





























Happy Sketching!
Nate