3 articles tagged with "pymel":

Maya Python: Reset Selected Controls

Posted on October 01, 2013 - category: python

Reset Selected Script

I have a script snippet to share with you today. This is how I quickly reset all selected objects to 0,0,0,0,0,0,1,1,1 in translate, rotate and scale with the stroke of a hotkey command.

This is fantastically useful when you are animating! But it’s also for riggers, modellers or anyone working in Maya. Softimage XSI has this feature built in (Ctrl-Shift-R), so I made a little snippet to do the same in …

Continue reading

Manually Create a Single Maya Follicle in Python

Posted on February 22, 2013 - category: character-rigging

Do you use Maya follicles to pin objects to your geometry? Are you still doing it the old way, by creating a Hair System and then deleting all the parts you don’t need? Below I’ll share my simple Maya Python script that creates and pins a single follicle onto a nurbs surface. (Jump straight to the script.)

I love using follicles. They adhere to a nurbs or poly surface and they maintain a good, predictable orientation in normal …

Continue reading

Python: String Formatting and Enumerate

Posted on February 21, 2012 - category: python

As a mostly self-taught Python scripter, I try to keep on top of best-practices and constantly learn, because I realize how easily bad habits can slip in. I’ve recently learned these bad habits are known as anti-patterns.

That said, I learned a couple new Python tricks this week.

1. Better String Formatting Using Format()

If you’ve used string formatting before, this is very similar, except the replacement fields are inside {} brackets, and you can use variables as keywords …

Continue reading