PDA

View Full Version : Python Rigging Scripts?


EightBit
09-18-2009, 09:01 PM
I've decided to try to do all future scripting in Python.
Does anyone have some simple rigging scripts that they would share as something I can start with?
I'm looking for stuff like setting up joints chains, joints on a curve, setting up IK, simple dynamics - like setting up a dynamic chain w/hair follicle.
I have a lot of MEL code for these things, so if I can get a few simple Python examples, I can take a larger first step, which would be very helpful.
Thanks much.

czemiello
09-20-2009, 10:30 AM
Hey hello man. Why do you need python scripts? All you have to do is understanding of python syntax and the difference between python and mel. Just try to learn python itself at first. Try simple coding hello world etc. then just import maya.cmds module and do the things like in mel but with python syntax. Python is much more powerful than mel so Good luck!

EightBit
09-20-2009, 04:53 PM
I'm already past the basics.
I've been coding for 20 years - more as an artist than a hard-core programmer. Have a code base to reverse engineer and copy/paste from would make the learning curve a bit shorter. Either way I'll get there.
Thanks.

uiron
09-20-2009, 08:49 PM
first thing to do is NOT to code Python like you're used for Mel. In python you can really take advantage of newest programming features, and that's where you stop thinking in a shell-like, procedural-flow oriented, prefix-namespacing way and start using things like OOP features, sophisticated flow control (exception handling, various looping/recursing options), packages and class static methods for namespacing, etc.

i very much recommend Eclipse and Pydev extensions for it for working with Python in maya.

you can also have a look at PyMel and it's examples - i'm not using it myself, due to whole code base being based on an inhouse framework, but i see it being very popular as well.

efecto
09-20-2009, 11:51 PM
What you can do is to download a simple rigging script written in MEL then convert that to python.. if you have been coding for 20 years and past the basic in python you should have no problem converting MEL to python.

djx
09-21-2009, 12:30 PM
The zooToolbox got an update this week, and I noticed that Hamish is rewriting some of his tools with python. Might be worth a look.

-- David

EightBit
09-24-2009, 02:43 PM
Thanks for the replies:
One thing I've noticed is that ppl don't seem to make the procs global in Python - is that not necessary?

CGTalk Moderation
09-24-2009, 02:43 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.