Michael Trainor - Technical Artist

Follow michaeltrainor on Twitter

Monday
Aug092010

Sphinx - Python Documentation Generator

Greetings!

I am in the process of writing a custom Python API for my studio. I’ve been tasked with providing a documentation system to allow my colleagues to build their own tools based on our custom API base classes and functions. I have chosen Sphinx, as it is what Python uses to create their own docs online. Sphinx offers a very cool ‘autodoc’ extension that...well...automatically documents your code based on your docstrings. Sphinx also offers a fairly easy-to-learn documentation language that transforms your docstrings into powerful learning tools.

Sphinx - http://sphinx.pocoo.org/index.html

The autodoc extenstion - http://sphinx.pocoo.org/ext/autodoc.html#module-sphinx.ext.autodoc

 

Sunday
Aug082010

StarCraft II - The Newb Experience

It's been about a year or so since I started playing games again. I've played Wow, LotRO, and about 40+ random platformers on Steam. I even bought a PlayStation3. I've tried everything from Heavy Rain to Red Dead Redemption. I got lost in Little Big Planet and found myself in the underworld battling Hates in GOW3. Purchased a Nintendo Wii so I could sell it. Given the amount of time and money I've spent to play these games, there was always something missing. They were all lacking the sense of fun and accomplishment that I used to thrive on as a kid with a NES Max controller in hand.

Then I bought StarCraft II. Holy hell...I feel like I'm ten years old again. I just played a solid 3 hours until my eyes hurt. I didn't sit there battling the Dominion out of some obsession with quest grinding, or some lost sense of devotion for my guild or character. I sat there, because I was having too much fun to move.

Welcome back to the fun of gaming.

-Michael

Friday
Aug062010

Swap Selected Visible Objects - Maya Python Script

Here's a little script that sets the transform visibility attribute of all selected object hierarchies to True, while setting all other transform visibility attributes to False. This is a real time saver when digging through a heavy scene. It comes in real handy when weighting multiple objects. I hope you find it useful.

 import maya.cmds as cmds

#Set selection mode and select hierarchy of selected objects

cmds.selectMode( q=True, component=True )

cmds.select(hi = True)

#Add object parents to selection

objParent = cmds.pickWalk(direction = 'up')

cmds.select(objParent, add = True)

#Set all visible objects transform visibility attributes to False

visibleObjectTranform = cmds.ls(v = True, tr = True)

for obj in visibleObjectTranform:

cmds.setAttr(obj + ".visibility", 0)

#Set all selected object transform visibility attributes to True

selectedObjects = cmds.ls(sl = True)

for obj in selectedObjects:

cmds.setAttr(obj + ".visibility", 1)

cmds.select(cl = True)